summaryrefslogtreecommitdiffstats
path: root/src/sql
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-09-26 16:08:55 +0200
committerLiang Qi <liang.qi@qt.io>2017-09-26 16:14:54 +0200
commitaadfe7d634de04519102c5827ca885dc2e2199c9 (patch)
treed92db346ca95332b177036a53f1f6beb2e24fb74 /src/sql
parent4b6c1448047362b8c38d265e6414f0e3e59b8d37 (diff)
parenta732e16d5fd9dbf8a0289fec9f948b12e9ba2c19 (diff)
Merge remote-tracking branch 'origin/5.10' into dev
Conflicts: src/gui/kernel/qguiapplication.cpp src/platformsupport/input/libinput/qlibinputpointer.cpp src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h src/plugins/platforms/cocoa/qcocoawindow.h src/testlib/qtestsystem.h Change-Id: I5975ffb3261c2dd82fe02ec4e57df7c0950226c5
Diffstat (limited to 'src/sql')
-rw-r--r--src/sql/kernel/qsqldatabase.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/sql/kernel/qsqldatabase.cpp b/src/sql/kernel/qsqldatabase.cpp
index bca981a865..14374c7ca9 100644
--- a/src/sql/kernel/qsqldatabase.cpp
+++ b/src/sql/kernel/qsqldatabase.cpp
@@ -365,6 +365,14 @@ void QSqlDatabasePrivate::disable()
cloneDatabase() to create an independent database connection based
on an existing one.
+ \warning It is highly recommended that you do not keep a copy of the
+ QSqlDatabase around as a member of a class, as this will prevent the
+ instance from being correctly cleaned up on shutdown. If you need to
+ access an existing QSqlDatabase, it should be accessed with database().
+ If you chose to have a QSqlDatabase member variable, this needs to be
+ deleted before the QCoreApplication instance is deleted, otherwise it
+ may lead to undefined behavior.
+
If you create multiple database connections, specify a unique
connection name for each one, when you call addDatabase(). Use
database() with a connection name to get that connection. Use