Fix terminate handler to prevent double channel close, up to 0.1.5

This commit is contained in:
jar3b 2019-06-18 23:16:44 +03:00
parent f7d5b41aba
commit 9eec782920

View File

@ -32,7 +32,9 @@ func (w *Waiter) terminateHandler(h *CloseHandler, forceWaitGroupDone bool) {
if h.handlerFunc != nil && *h.handlerFunc != nil {
(*h.handlerFunc)()
}
close(h.Quit)
if h.active {
close(h.Quit)
}
if h.autoDone || forceWaitGroupDone {
w.waitGroup.Done()
}