SocketAPI: Properly release precompiled statements. Use sqlite3_close

rather than its v2 equivalent. That should make it compile on older
linux platforms.
This commit is contained in:
Klaas Freitag 2014-10-20 10:50:57 +02:00
parent 2dfe0ed42e
commit 3fcb0d2d6b
2 changed files with 7 additions and 3 deletions

View file

@ -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;
}
}

View file

@ -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);
}
}