ownSql: Don't allow copying of SqlQuery

This fixes a crash on OS X where the destructor
calls sqlite3 to invalidate the underlying handle.
This commit is contained in:
Markus Goetz 2014-10-16 15:10:25 +02:00
parent 36eaff92e5
commit dbad1a8d45
2 changed files with 4 additions and 1 deletions

View file

@ -43,6 +43,7 @@ private:
class SqlQuery
{
Q_DISABLE_COPY(SqlQuery)
public:
explicit SqlQuery();
explicit SqlQuery(SqlDatabase db);

View file

@ -605,7 +605,7 @@ int SyncJournalDb::getFileRecordCount()
return 0;
}
static void toDownloadInfo(SqlQuery query, SyncJournalDb::DownloadInfo * res)
static void toDownloadInfo(SqlQuery &query, SyncJournalDb::DownloadInfo * res)
{
bool ok = true;
res->_tmpfile = query.stringValue(0);
@ -651,6 +651,8 @@ SyncJournalDb::DownloadInfo SyncJournalDb::getDownloadInfo(const QString& file)
if( _getDownloadInfoQuery->next() ) {
toDownloadInfo(*_getDownloadInfoQuery, &res);
} else {
res._valid = false;
}
_getDownloadInfoQuery->reset();
}