No longer panic if we fail to close the connection when dropping it.

This commit is contained in:
Mark Hammond 2023-02-24 15:13:25 +11:00
parent 9880cdef12
commit 9c2cc12b08
No known key found for this signature in database
GPG Key ID: 71E6BB4A5D4081F3

View File

@ -371,15 +371,7 @@ impl Drop for InnerConnection {
#[allow(unused_must_use)]
#[inline]
fn drop(&mut self) {
use std::thread::panicking;
if let Err(e) = self.close() {
if panicking() {
eprintln!("Error while closing SQLite connection: {e:?}");
} else {
panic!("Error while closing SQLite connection: {:?}", e);
}
}
self.close();
}
}