[Pkg-owncloud-commits] [owncloud-client] 97/211: ownSql: Don't allow copying of SqlQuery
Sandro Knauß
hefee-guest at moszumanska.debian.org
Sat Oct 25 09:10:30 UTC 2014
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository owncloud-client.
commit dbad1a8d45b12e6dfe4f49f60d09712d0b8dbce2
Author: Markus Goetz <markus at woboq.com>
Date: Thu Oct 16 15:10:25 2014 +0200
ownSql: Don't allow copying of SqlQuery
This fixes a crash on OS X where the destructor
calls sqlite3 to invalidate the underlying handle.
---
src/mirall/ownsql.h | 1 +
src/mirall/syncjournaldb.cpp | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/mirall/ownsql.h b/src/mirall/ownsql.h
index b1091f5..eacd5b3 100644
--- a/src/mirall/ownsql.h
+++ b/src/mirall/ownsql.h
@@ -43,6 +43,7 @@ private:
class SqlQuery
{
+ Q_DISABLE_COPY(SqlQuery)
public:
explicit SqlQuery();
explicit SqlQuery(SqlDatabase db);
diff --git a/src/mirall/syncjournaldb.cpp b/src/mirall/syncjournaldb.cpp
index 611e244..6e32762 100644
--- a/src/mirall/syncjournaldb.cpp
+++ b/src/mirall/syncjournaldb.cpp
@@ -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();
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git
More information about the Pkg-owncloud-commits
mailing list