From 31563434b6c15cba45b6ae4f3ef8b50e702b4ad3 Mon Sep 17 00:00:00 2001 From: Uwe Klotz Date: Sun, 28 May 2017 11:50:50 +0200 Subject: Avoid passing QSqlDatabase by mutable reference ...otherwise someone would be able to replace the implicitly shared instance behind it! --- src/library/queryutil.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/library/queryutil.h') diff --git a/src/library/queryutil.h b/src/library/queryutil.h index a0742ac83b..bcc10b8b98 100644 --- a/src/library/queryutil.h +++ b/src/library/queryutil.h @@ -10,7 +10,7 @@ class ScopedTransaction { public: - explicit ScopedTransaction(QSqlDatabase& database) : + explicit ScopedTransaction(const QSqlDatabase& database) : m_database(database), m_active(false) { if (!transaction()) { @@ -62,7 +62,7 @@ class ScopedTransaction { return result; } private: - QSqlDatabase& m_database; + QSqlDatabase m_database; bool m_active; }; -- cgit v1.2.3