mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-22 07:09:20 +08:00
Merge pull request #1293 from mhammond/no-panic-on-drop
No longer panic if we fail to close the connection when dropping it.
This commit is contained in:
commit
929be82c9f
@ -371,15 +371,7 @@ impl Drop for InnerConnection {
|
|||||||
#[allow(unused_must_use)]
|
#[allow(unused_must_use)]
|
||||||
#[inline]
|
#[inline]
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
use std::thread::panicking;
|
self.close();
|
||||||
|
|
||||||
if let Err(e) = self.close() {
|
|
||||||
if panicking() {
|
|
||||||
eprintln!("Error while closing SQLite connection: {e:?}");
|
|
||||||
} else {
|
|
||||||
panic!("Error while closing SQLite connection: {:?}", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user