2 Commits

Author SHA1 Message Date
jar3b
9eec782920 Fix terminate handler to prevent double channel close, up to 0.1.5 2019-06-18 23:16:44 +03:00
jar3b
f7d5b41aba Use 'close(h.Quit)' instead of <- struct{}{}, up to 0.1.4 2019-06-18 01:12:42 +03:00

View File

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