summaryrefslogtreecommitdiffstats
path: root/src/library/queryutil.h
diff options
context:
space:
mode:
authorUwe Klotz <uwe_klotz@web.de>2017-05-28 11:50:50 +0200
committerUwe Klotz <uwe_klotz@web.de>2017-06-12 07:30:17 +0200
commit31563434b6c15cba45b6ae4f3ef8b50e702b4ad3 (patch)
treeafb875ca1b4b9fa3473b043fb93b53e432aeda19 /src/library/queryutil.h
parentc57466ba8b47009a1d2fd5043c0beb37dfc8825b (diff)
Avoid passing QSqlDatabase by mutable reference
...otherwise someone would be able to replace the implicitly shared instance behind it!
Diffstat (limited to 'src/library/queryutil.h')
-rw-r--r--src/library/queryutil.h4
1 files changed, 2 insertions, 2 deletions
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;
};