From 176f05921d638aeb6e546126f11fcd8a13f0cb71 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 1 Dec 2011 18:02:51 +0200 Subject: Instantiate QCoreApplication in Qt tests/examples It performs Qt initialization/finalization and without it bad things will happen (like deleting TLS keys that don't belong to Qt). --- qt/mysql/basic/driver.cxx | 4 ++++ qt/mysql/date-time/driver.cxx | 3 +++ qt/mysql/template/driver.cxx | 4 ++++ 3 files changed, 11 insertions(+) (limited to 'qt/mysql') diff --git a/qt/mysql/basic/driver.cxx b/qt/mysql/basic/driver.cxx index ed3165e..d2eebd6 100644 --- a/qt/mysql/basic/driver.cxx +++ b/qt/mysql/basic/driver.cxx @@ -10,6 +10,8 @@ #include #include +#include + #include #include @@ -24,6 +26,8 @@ using namespace odb::core; int main (int argc, char* argv[]) { + QCoreApplication app (argc, argv); + try { auto_ptr db (create_database (argc, argv)); diff --git a/qt/mysql/date-time/driver.cxx b/qt/mysql/date-time/driver.cxx index a6637bb..34eea5d 100644 --- a/qt/mysql/date-time/driver.cxx +++ b/qt/mysql/date-time/driver.cxx @@ -11,6 +11,7 @@ #include #include +#include #include #include @@ -29,6 +30,8 @@ test_out_of_range_value (object&, database&); int main (int argc, char* argv[]) { + QCoreApplication app (argc, argv); + try { auto_ptr db (create_database (argc, argv)); diff --git a/qt/mysql/template/driver.cxx b/qt/mysql/template/driver.cxx index c94096b..bd12e22 100644 --- a/qt/mysql/template/driver.cxx +++ b/qt/mysql/template/driver.cxx @@ -10,6 +10,8 @@ #include #include +#include + #include #include @@ -24,6 +26,8 @@ using namespace odb::core; int main (int argc, char* argv[]) { + QCoreApplication app (argc, argv); + try { auto_ptr db (create_database (argc, argv)); -- cgit v1.1