diff --git a/progress.go b/progress.go index a345922..6db02fa 100644 --- a/progress.go +++ b/progress.go @@ -236,6 +236,16 @@ p.once.Do(p.shutdown) // wait for container to quit + p.cwg.Wait() +} + +// Shutdown cancels any running bar immediatly and then shutdowns (*Progress) +// instance. Normally you shouldn't call this method unless you know what are +// you doing. Proper way to shutdown is to call (*Progress).Wait() instead. +func (p *Progress) Shutdown() { + p.cancel() + p.bwg.Wait() + p.once.Do(p.shutdown) p.cwg.Wait() }