Skip to content

Commit

Permalink
Fixes crash when disconnect is trigged twice
Browse files Browse the repository at this point in the history
  • Loading branch information
stamp committed Feb 16, 2019
1 parent 512c352 commit fea5561
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
language: go
go:
- 1.5
- 1.6
- 1.11
- tip
2 changes: 1 addition & 1 deletion device_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit fea5561

Please sign in to comment.