mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-24 22:15:57 +03:00
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:
parent
36eaff92e5
commit
dbad1a8d45
2 changed files with 4 additions and 1 deletions
|
@ -43,6 +43,7 @@ private:
|
|||
|
||||
class SqlQuery
|
||||
{
|
||||
Q_DISABLE_COPY(SqlQuery)
|
||||
public:
|
||||
explicit SqlQuery();
|
||||
explicit SqlQuery(SqlDatabase db);
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue