diff --git a/waiter.go b/waiter.go index d5a5c60..e2b6928 100644 --- a/waiter.go +++ b/waiter.go @@ -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() }