mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-09-17 02:16:54 +00:00
Change MsgChannelKeepalive to a sync.WaitGroup
This commit is contained in:
parent
46887cdb5d
commit
013e49e2c5
3 changed files with 19 additions and 26 deletions
|
@ -257,11 +257,11 @@ RunLoop:
|
|||
// Stop getting messages...
|
||||
UnsubscribeAll(&client)
|
||||
|
||||
client.MsgChannelKeepalive.Lock()
|
||||
// Wait for pending jobs to finish...
|
||||
client.MsgChannelKeepalive.Wait()
|
||||
client.MessageChannel = nil
|
||||
client.MsgChannelKeepalive.Unlock()
|
||||
|
||||
// And finished.
|
||||
// And done.
|
||||
// Close the channel so the draining goroutine can finish, too.
|
||||
close(_serverMessageChan)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue