From 894f0aa04867ef948cfe72c9d9893292e147d73f Mon Sep 17 00:00:00 2001 From: Vladimir Bauer Date: Fri, 16 Aug 2024 18:01:19 +0500 Subject: [PATCH] wait for user wg last --- progress.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/progress.go b/progress.go index bbff7db5..5c57eafa 100644 --- a/progress.go +++ b/progress.go @@ -225,13 +225,12 @@ func (p *Progress) Write(b []byte) (int, error) { // Wait waits for all bars to complete and finally shutdowns container. After // this method has been called, there is no way to reuse `*Progress` instance. func (p *Progress) Wait() { + p.bwg.Wait() + p.Shutdown() // wait for user wg, if any if p.uwg != nil { p.uwg.Wait() } - - p.bwg.Wait() - p.Shutdown() } // Shutdown cancels any running bar immediately and then shutdowns `*Progress`