Fix terminate handler to prevent double channel close, up to 0.1.5
This commit is contained in:
parent
f7d5b41aba
commit
9eec782920
@ -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)()
|
||||||
}
|
}
|
||||||
close(h.Quit)
|
if h.active {
|
||||||
|
close(h.Quit)
|
||||||
|
}
|
||||||
if h.autoDone || forceWaitGroupDone {
|
if h.autoDone || forceWaitGroupDone {
|
||||||
w.waitGroup.Done()
|
w.waitGroup.Done()
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user