summaryrefslogtreecommitdiff
path: root/tests/auto
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2013-04-05 18:07:23 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-05 19:05:57 +0200
commit0e1bb27c446f5c5f6bbb3c06fd0d188d10de1d7c (patch)
treeb2e767fe23f12cba71a3986c42a7e4afb3b28930 /tests/auto
parent84102e1eaf19ede040444fb458a2fc23ecefb3d4 (diff)
downloadqtxmlpatterns-0e1bb27c446f5c5f6bbb3c06fd0d188d10de1d7c.tar.gz
Fix exit crash in xmlpatternsvalidator.
Clean up QNetworkAccessManager using qAddPostRoutine(). Change-Id: I6ee8b0bcccf09abf4e4b35e063f48f6d7a631bfe Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/xmlpatternssdk/TestSuiteHandler.cpp17
-rw-r--r--tests/auto/xmlpatternssdk/XSLTTestSuiteHandler.cpp17
2 files changed, 32 insertions, 2 deletions
diff --git a/tests/auto/xmlpatternssdk/TestSuiteHandler.cpp b/tests/auto/xmlpatternssdk/TestSuiteHandler.cpp
index e7423d1..3a44b8b 100644
--- a/tests/auto/xmlpatternssdk/TestSuiteHandler.cpp
+++ b/tests/auto/xmlpatternssdk/TestSuiteHandler.cpp
@@ -52,7 +52,22 @@
using namespace QPatternistSDK;
-Q_GLOBAL_STATIC(QNetworkAccessManager, networkAccessManager)
+static QNetworkAccessManager *s_networkAccessManager = 0;
+
+static void cleanupNetworkAccessManager()
+{
+ delete s_networkAccessManager;
+ s_networkAccessManager = 0;
+
+}
+static QNetworkAccessManager *networkAccessManager()
+{
+ if (!s_networkAccessManager) {
+ s_networkAccessManager = new QNetworkAccessManager;
+ qAddPostRoutine(cleanupNetworkAccessManager);
+ }
+ return s_networkAccessManager;
+}
TestSuiteHandler::TestSuiteHandler(const QUrl &catalogFile,
const bool useEList) : m_ts(0)
diff --git a/tests/auto/xmlpatternssdk/XSLTTestSuiteHandler.cpp b/tests/auto/xmlpatternssdk/XSLTTestSuiteHandler.cpp
index 080ffac..c0d5a14 100644
--- a/tests/auto/xmlpatternssdk/XSLTTestSuiteHandler.cpp
+++ b/tests/auto/xmlpatternssdk/XSLTTestSuiteHandler.cpp
@@ -52,7 +52,22 @@
using namespace QPatternistSDK;
-Q_GLOBAL_STATIC(QNetworkAccessManager, networkAccessManager)
+static QNetworkAccessManager *s_networkAccessManager = 0;
+
+static void cleanupNetworkAccessManager()
+{
+ delete s_networkAccessManager;
+ s_networkAccessManager = 0;
+
+}
+static QNetworkAccessManager *networkAccessManager()
+{
+ if (!s_networkAccessManager) {
+ s_networkAccessManager = new QNetworkAccessManager;
+ qAddPostRoutine(cleanupNetworkAccessManager);
+ }
+ return s_networkAccessManager;
+}
XSLTTestSuiteHandler::XSLTTestSuiteHandler(const QUrl &catalogFile) : m_ts(0)
, m_tc(0)