From 3fcb0d2d6b5c6fa32c47ec13dc8f54036a613bf0 Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Mon, 20 Oct 2014 10:50:57 +0200 Subject: [PATCH] SocketAPI: Properly release precompiled statements. Use sqlite3_close rather than its v2 equivalent. That should make it compile on older linux platforms. --- src/mirall/ownsql.cpp | 2 +- src/mirall/socketapi.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/mirall/ownsql.cpp b/src/mirall/ownsql.cpp index ac66c2cdd..075b68284 100644 --- a/src/mirall/ownsql.cpp +++ b/src/mirall/ownsql.cpp @@ -66,7 +66,7 @@ QString SqlDatabase::error() const void SqlDatabase::close() { if( _db ) { - SQLITE_DO(sqlite3_close_v2(_db) ); + SQLITE_DO(sqlite3_close(_db) ); _db = 0; } } diff --git a/src/mirall/socketapi.cpp b/src/mirall/socketapi.cpp index 039dcf883..606f3db7a 100644 --- a/src/mirall/socketapi.cpp +++ b/src/mirall/socketapi.cpp @@ -226,9 +226,13 @@ void SocketApi::slotUnregisterPath( const QString& alias ) broadcastMessage(QLatin1String("UNREGISTER_PATH"), f->path(), QString::null, true ); if( _dbConnections.contains(f)) { - sqlite3_close_v2(_dbConnections[f]._db); + SqliteHandle h = _dbConnections[f]; + if( h._stmt ) { + sqlite3_finalize(h._stmt); + } + sqlite3_close(h._db); + _dbConnections.remove(f); } - _dbConnections.remove(f); } }