From a53bcd47693c8b9d0396b89c8e3db983530298f5 Mon Sep 17 00:00:00 2001 From: gwenn Date: Tue, 23 Jul 2024 19:19:44 +0200 Subject: [PATCH] Prevent interrupt from non-owned connection Fix #1546 --- src/inner_connection.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/inner_connection.rs b/src/inner_connection.rs index 6c4e6c0..5811a85 100644 --- a/src/inner_connection.rs +++ b/src/inner_connection.rs @@ -46,7 +46,7 @@ impl InnerConnection { pub unsafe fn new(db: *mut ffi::sqlite3, owned: bool) -> InnerConnection { InnerConnection { db, - interrupt_lock: Arc::new(Mutex::new(db)), + interrupt_lock: Arc::new(Mutex::new(if owned { db } else { ptr::null_mut() })), #[cfg(feature = "hooks")] free_commit_hook: None, #[cfg(feature = "hooks")]