diff --git a/progress.go b/progress.go index 753e1f4..d411f3a 100644 --- a/progress.go +++ b/progress.go @@ -72,7 +72,6 @@ // context. It's not possible to reuse instance after (*Progress).Wait // method has been called. func NewWithContext(ctx context.Context, options ...ContainerOption) *Progress { - ctx, cancel := context.WithCancel(ctx) s := &pState{ rr: prr, bHeap: priorityQueue{}, @@ -95,6 +94,7 @@ s.shutdownNotifier = make(chan struct{}) } + ctx, cancel := context.WithCancel(ctx) p := &Progress{ ctx: ctx, uwg: s.uwg,