summaryrefslogtreecommitdiffstats
path: root/tests/auto/sql/models/CMakeLists.txt
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-06-30 18:49:57 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-07-01 10:03:57 +0200
commitfb55e1e71e3c98aca880c23d97f9e811e2b406a0 (patch)
treee7543c1df9f17f59bc8430776ad35a454e52bb54 /tests/auto/sql/models/CMakeLists.txt
parenta0468331761b497992e9d554c210583781308272 (diff)
Sql: Fix heap-user-after-free for globally initialized db objects
Becaues the database objects were created as globals, there was a possible use-after-free issue when deleting the objects on application exit. Move the initialization of the database objects into static variables inside the test constructor. As a drive-by, also add one missing test to the CMake projects. Fixes: QTBUG-85357 Change-Id: I2c8f2c5daee96bb9d1d21dae37950a2da5ffdf27 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'tests/auto/sql/models/CMakeLists.txt')
-rw-r--r--tests/auto/sql/models/CMakeLists.txt4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/auto/sql/models/CMakeLists.txt b/tests/auto/sql/models/CMakeLists.txt
index df530443c4..ce44f587de 100644
--- a/tests/auto/sql/models/CMakeLists.txt
+++ b/tests/auto/sql/models/CMakeLists.txt
@@ -1,6 +1,8 @@
+# Generated from models.pro.
+
add_subdirectory(qsqlrelationaltablemodel)
add_subdirectory(qsqltablemodel)
-
if(TARGET Qt::Widgets)
add_subdirectory(qsqlquerymodel)
+ add_subdirectory(qsqlrelationaldelegate)
endif()