Skip to content

Commit

Permalink
Merge pull request #6 from stampzilla/stamp/disconnect-crash
Browse files Browse the repository at this point in the history
Fixes crash when disconnect is trigged twice
  • Loading branch information
jonaz authored Feb 17, 2019
2 parents 512c352 + fea5561 commit d0c2faf
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 d0c2faf

Please sign in to comment.