Added drop for Connection to prevent fd leak

Added call to flush_prepared_statement_cache
otherwise InnerConnection receives DatabaseBusy on sqlite3_close
This commit is contained in:
edelangh 2017-07-19 12:22:31 +02:00
parent d5bd7d9601
commit bdd4f9a1a9

View File

@ -185,6 +185,12 @@ pub struct Connection {
unsafe impl Send for Connection {} unsafe impl Send for Connection {}
impl Drop for Connection {
fn drop(&mut self) {
self.flush_prepared_statement_cache();
}
}
impl Connection { impl Connection {
/// Open a new connection to a SQLite database. /// Open a new connection to a SQLite database.
/// ///