Skip to content

Commit

Permalink
Prevent double panic in the Drop of TaksPoolInner
Browse files Browse the repository at this point in the history
  • Loading branch information
refnil committed Dec 14, 2020
1 parent e511cdb commit ac7b617
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/bevy_tasks/src/task_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ impl Drop for TaskPoolInner {
fn drop(&mut self) {
self.shutdown_tx.close();

let panicking = thread::panicking();
for join_handle in self.threads.drain(..) {
join_handle
.join()
.expect("Task thread panicked while executing.");
let res = join_handle.join();
if !panicking { res.expect("Task thread panicked while executing."); }
}
}
}
Expand Down

0 comments on commit ac7b617

Please sign in to comment.