diff options
author | Cristiano di Flora <cristiano.di-flora@nokia.com> | 2011-02-22 03:27:51 (GMT) |
---|---|---|
committer | Cristiano di Flora <cristiano.di-flora@nokia.com> | 2011-02-22 04:48:51 (GMT) |
commit | 4d3b9aa83cf7f6d9f9b88d9936e5980629daac2a (patch) | |
tree | c6535ce67ff7d21e448c4a384d79cf3d1d137225 | |
parent | 37fffc23dae8e10c89d5ad78e7e5d08693b4cb17 (diff) | |
download | Qt-4d3b9aa83cf7f6d9f9b88d9936e5980629daac2a.zip Qt-4d3b9aa83cf7f6d9f9b88d9936e5980629daac2a.tar.gz Qt-4d3b9aa83cf7f6d9f9b88d9936e5980629daac2a.tar.bz2 |
Fix QNetworkConfigurationManager crash due to null private pointer.
Reviewed-by: Aaron McCarthy
Task-Number: QTBUG-17305
(cherry picked from commit 7388fcb83592a90aace054314e0c3e7e7a94fdae)
-rw-r--r-- | src/network/bearer/qnetworkconfigmanager.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/network/bearer/qnetworkconfigmanager.cpp b/src/network/bearer/qnetworkconfigmanager.cpp index 0e3c519..7eadb82 100644 --- a/src/network/bearer/qnetworkconfigmanager.cpp +++ b/src/network/bearer/qnetworkconfigmanager.cpp @@ -57,16 +57,17 @@ QT_BEGIN_NAMESPACE { \ delete this_##NAME.pointer; \ this_##NAME.pointer = 0; \ - this_##NAME.destroyed = true; \ } \ static TYPE *NAME() \ { \ - if (!this_##NAME.pointer && !this_##NAME.destroyed) { \ + if (!this_##NAME.pointer) { \ TYPE *x = new TYPE; \ if (!this_##NAME.pointer.testAndSetOrdered(0, x)) \ delete x; \ - else \ + else { \ qAddPostRoutine(NAME##_cleanup); \ + this_##NAME.pointer->updateConfigurations(); \ + } \ } \ return this_##NAME.pointer; \ } @@ -75,15 +76,7 @@ Q_GLOBAL_STATIC_QAPP_DESTRUCTION(QNetworkConfigurationManagerPrivate, connManage QNetworkConfigurationManagerPrivate *qNetworkConfigurationManagerPrivate() { - static bool initialized = false; - - QNetworkConfigurationManagerPrivate *m = connManager(); - if (!initialized) { - initialized = true; - m->updateConfigurations(); - } - - return m; + return connManager(); } /*! |