Properly lock before the close check
This commit is contained in:
parent
aa699f02a0
commit
7dd180eb83
|
@ -118,6 +118,8 @@ func (t *TwitchPubSub) Close() error {
|
||||||
t.listening = nil
|
t.listening = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
t.Lock()
|
||||||
|
|
||||||
if t.wsConn != nil {
|
if t.wsConn != nil {
|
||||||
// To cleanly close a connection, a client should send a close
|
// To cleanly close a connection, a client should send a close
|
||||||
// frame and wait for the server to close the connection.
|
// frame and wait for the server to close the connection.
|
||||||
|
|
Loading…
Reference in New Issue