From fea556152673ba84140eb029f9f0d181ddbdd814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Grimmtj=C3=A4rn?= Date: Sun, 17 Feb 2019 00:04:41 +0100 Subject: [PATCH] Fixes crash when disconnect is trigged twice --- .travis.yml | 3 +-- device_connection.go | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index fa032a1..c03964a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,4 @@ language: go go: - - 1.5 - - 1.6 + - 1.11 - tip diff --git a/device_connection.go b/device_connection.go index 49d4240..2a61f7a 100644 --- a/device_connection.go +++ b/device_connection.go @@ -128,11 +128,11 @@ func (d *Device) Disconnect() { d.Lock() d.subscriptions = make(map[string]*Subscription, 0) - d.Unlock() d.Dispatch(events.Disconnected{}) d.conn.Close() d.conn = nil + d.Unlock() } d.Lock()