From e8f1b9917008d978c29cda9a2b40b841bc7a9df4 Mon Sep 17 00:00:00 2001
From: Kai Koehne <kai.koehne@theqtcompany.com>
Date: Mon, 20 Oct 2014 14:09:33 +0200
Subject: [PATCH] Don't delete QLibrarySettings configuration in
 ~QCoreApplication

Do not clear the QLibrarySettings configuration information already
in ~QCoreApplication (via qAddPostRoutine). This fixes issues where
multiple QCoreApplication objects are created over time (in plugins).

Task-number: QTBUG-34290
Change-Id: Ib5c58f825619ede484492e057e08d73b2b4c6101
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
---
 src/corelib/global/qlibraryinfo.cpp | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index c3ec2bc7f67..7ca0aa7f0bf 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -84,14 +84,7 @@ class QLibraryInfoPrivate
 {
 public:
     static QSettings *findConfiguration();
-#ifndef QT_BOOTSTRAPPED
-    static void cleanup()
-    {
-        QLibrarySettings *ls = qt_library_settings();
-        if (ls)
-            ls->settings.reset(0);
-    }
-#else
+#ifdef QT_BOOTSTRAPPED
     static bool haveGroup(QLibraryInfo::PathGroup group)
     {
         QLibrarySettings *ls = qt_library_settings();
@@ -114,7 +107,6 @@ QLibrarySettings::QLibrarySettings()
     : settings(QLibraryInfoPrivate::findConfiguration())
 {
 #ifndef QT_BOOTSTRAPPED
-    qAddPostRoutine(QLibraryInfoPrivate::cleanup);
     bool haveEffectivePaths;
     bool havePaths;
 #endif
-- 
GitLab