From 44618a88c4e9da3f355795a7bee9ecdba79c8f5c Mon Sep 17 00:00:00 2001 From: Chris Laplante Date: Mon, 5 Feb 2024 16:59:20 -0500 Subject: [PATCH] fix inadvertently dropping MutexGuard in TickerControl --- src/progress_bar.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/progress_bar.rs b/src/progress_bar.rs index bd01da57..036ab1ef 100644 --- a/src/progress_bar.rs +++ b/src/progress_bar.rs @@ -687,7 +687,7 @@ impl TickerControl { drop(arc); // Also need to drop Arc otherwise BarState won't be dropped // Wait for `interval` but return early if we are notified to stop - let (_, result) = self + let result = self .stopping .1 .wait_timeout_while(self.stopping.0.lock().unwrap(), interval, |stopped| { @@ -696,7 +696,7 @@ impl TickerControl { .unwrap(); // If the wait didn't time out, it means we were notified to stop - if !result.timed_out() { + if !result.1.timed_out() { break; } }