SyncJournalDB, clear all the queries before closing the database

This commit is contained in:
Olivier Goffart 2015-10-30 14:03:08 +01:00
parent 16c078963b
commit aaf16ff0e8
2 changed files with 6 additions and 0 deletions

View file

@ -457,6 +457,8 @@ void SyncJournalDb::close()
_getFileRecordQuery.reset(0);
_setFileRecordQuery.reset(0);
_setFileRecordChecksumQuery.reset(0);
_setFileRecordMetadataQuery.reset(0);
_getDownloadInfoQuery.reset(0);
_setDownloadInfoQuery.reset(0);
_deleteDownloadInfoQuery.reset(0);
@ -468,6 +470,8 @@ void SyncJournalDb::close()
_getErrorBlacklistQuery.reset(0);
_setErrorBlacklistQuery.reset(0);
_getSelectiveSyncListQuery.reset(0);
_getChecksumTypeIdQuery.reset(0);
_insertChecksumTypeQuery.reset(0);
_db.close();
_avoidReadFromDbOnNextSyncFilter.clear();

View file

@ -166,6 +166,8 @@ private:
QString _dbFile;
QMutex _mutex; // Public functions are protected with the mutex.
int _transaction;
// NOTE! when adding a query, don't forget to reset it in SyncJournalDb::close
QScopedPointer<SqlQuery> _getFileRecordQuery;
QScopedPointer<SqlQuery> _setFileRecordQuery;
QScopedPointer<SqlQuery> _setFileRecordChecksumQuery;