mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-24 22:15:57 +03:00
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:
parent
2dfe0ed42e
commit
3fcb0d2d6b
2 changed files with 7 additions and 3 deletions
|
@ -66,7 +66,7 @@ QString SqlDatabase::error() const
|
||||||
void SqlDatabase::close()
|
void SqlDatabase::close()
|
||||||
{
|
{
|
||||||
if( _db ) {
|
if( _db ) {
|
||||||
SQLITE_DO(sqlite3_close_v2(_db) );
|
SQLITE_DO(sqlite3_close(_db) );
|
||||||
_db = 0;
|
_db = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -226,9 +226,13 @@ void SocketApi::slotUnregisterPath( const QString& alias )
|
||||||
broadcastMessage(QLatin1String("UNREGISTER_PATH"), f->path(), QString::null, true );
|
broadcastMessage(QLatin1String("UNREGISTER_PATH"), f->path(), QString::null, true );
|
||||||
|
|
||||||
if( _dbConnections.contains(f)) {
|
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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue