Skip to content

Commit

Permalink
No-op MultiState::draw if we are panicking
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-laplante committed Sep 8, 2022
1 parent b9dcd47 commit a19269e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/multi.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::fmt::{Debug, Formatter};
use std::io;
use std::sync::{Arc, Mutex, RwLock, Weak};
use std::thread::panicking;
use std::time::Instant;

use crate::draw_target::{DrawState, DrawStateWrapper, ProgressDrawTarget};
Expand Down Expand Up @@ -208,6 +209,10 @@ impl MultiState {
extra_lines: Option<Vec<String>>,
now: Instant,
) -> io::Result<()> {
if panicking() {
return Ok(());
}

// Reap all consecutive 'zombie' progress bars from head of the list
let mut adjust = 0;
while let Some(index) = self.ordering.first().copied() {
Expand Down

0 comments on commit a19269e

Please sign in to comment.