mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00: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
@ -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 New Issue
Block a user