From a00e52373d2995cdab6c17f31cd354636145ab44 Mon Sep 17 00:00:00 2001 From: Oleg Shparber Date: Sun, 10 May 2026 04:01:14 +0300 Subject: [PATCH] fix(util): use sqlite3_close_v2 in Database --- src/libs/util/database.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libs/util/database.cpp b/src/libs/util/database.cpp index 05be0d10..04bd0cfb 100644 --- a/src/libs/util/database.cpp +++ b/src/libs/util/database.cpp @@ -133,7 +133,10 @@ QString Database::lastError() const void Database::close() { - sqlite3_close(m_db); + // Use the _v2 variant so that any prepared statements still alive at + // shutdown defer the actual deallocation instead of returning SQLITE_BUSY + // and leaking the connection. + sqlite3_close_v2(m_db); m_db = nullptr; }