Skip to content

Commit

Permalink
no panic
Browse files Browse the repository at this point in the history
  • Loading branch information
nameexhaustion committed Mar 5, 2025
1 parent 916638f commit a5ff78f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions crates/polars-io/src/cloud/adaptors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,11 @@ impl Drop for CloudWriter {
fn drop(&mut self) {
// TODO: Once we are properly calling `close()` from all contexts this can instead be a
// debug_assert that we are in an `Err(_)` state when dropping.
match self.inner {
WriterState::Open(_) => self.close_sync().unwrap(),
WriterState::Err(_) => {},
if !std::thread::panicking() {
match self.inner {
WriterState::Open(_) => self.close_sync().unwrap(),
WriterState::Err(_) => {},
}
}
}
}
Expand Down

0 comments on commit a5ff78f

Please sign in to comment.