diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-12-01 18:02:51 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-12-01 18:02:51 +0200 |
commit | 176f05921d638aeb6e546126f11fcd8a13f0cb71 (patch) | |
tree | e16f3d34f0983c844a9d3f2a6874ca7b340e297e /qt/sqlite | |
parent | 178d0a28bd7d69799828d1640a02731cb42f1b4d (diff) |
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).
Diffstat (limited to 'qt/sqlite')
-rw-r--r-- | qt/sqlite/basic/driver.cxx | 4 | ||||
-rw-r--r-- | qt/sqlite/date-time/driver.cxx | 3 | ||||
-rw-r--r-- | qt/sqlite/template/driver.cxx | 4 |
3 files changed, 11 insertions, 0 deletions
diff --git a/qt/sqlite/basic/driver.cxx b/qt/sqlite/basic/driver.cxx index f24053a..c925f65 100644 --- a/qt/sqlite/basic/driver.cxx +++ b/qt/sqlite/basic/driver.cxx @@ -10,6 +10,8 @@ #include <cassert> #include <iostream> +#include <QtCore/QCoreApplication> + #include <odb/sqlite/database.hxx> #include <odb/sqlite/transaction.hxx> @@ -24,6 +26,8 @@ using namespace odb::core; int main (int argc, char* argv[]) { + QCoreApplication app (argc, argv); + try { auto_ptr<database> db (create_database (argc, argv)); diff --git a/qt/sqlite/date-time/driver.cxx b/qt/sqlite/date-time/driver.cxx index a095aa5..0ee5831 100644 --- a/qt/sqlite/date-time/driver.cxx +++ b/qt/sqlite/date-time/driver.cxx @@ -11,6 +11,7 @@ #include <iostream> #include <QtCore/QDateTime> +#include <QtCore/QCoreApplication> #include <odb/sqlite/database.hxx> #include <odb/sqlite/transaction.hxx> @@ -29,6 +30,8 @@ test_out_of_range_value (object&, database&); int main (int argc, char* argv[]) { + QCoreApplication app (argc, argv); + try { auto_ptr<database> db (create_database (argc, argv)); diff --git a/qt/sqlite/template/driver.cxx b/qt/sqlite/template/driver.cxx index cce886a..c02cf06 100644 --- a/qt/sqlite/template/driver.cxx +++ b/qt/sqlite/template/driver.cxx @@ -10,6 +10,8 @@ #include <cassert> #include <iostream> +#include <QtCore/QCoreApplication> + #include <odb/sqlite/database.hxx> #include <odb/sqlite/transaction.hxx> @@ -24,6 +26,8 @@ using namespace odb::core; int main (int argc, char* argv[]) { + QCoreApplication app (argc, argv); + try { auto_ptr<database> db (create_database (argc, argv)); |