Fix memory leak and add test

This commit is contained in:
gwenn
2017-04-26 20:12:48 +02:00
parent 6eb98afd67
commit 63a444a95f
2 changed files with 67 additions and 20 deletions

View File

@@ -781,6 +781,7 @@ impl InnerConnection {
}
fn close(&mut self) -> Result<()> {
self.remove_hooks();
unsafe {
let r = ffi::sqlite3_close(self.db());
let r = self.decode_result(r);
@@ -857,6 +858,10 @@ impl InnerConnection {
fn changes(&mut self) -> c_int {
unsafe { ffi::sqlite3_changes(self.db()) }
}
#[cfg(not(feature = "hooks"))]
fn remove_hooks(&mut self) {
}
}
impl Drop for InnerConnection {