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 03:27:51 (GMT) |
commit | 7388fcb83592a90aace054314e0c3e7e7a94fdae (patch) | |
tree | 85999eec5995716a6cf1c8198c6a409f720ef3bf /src/network/bearer | |
parent | 40ef3923c8fb352db7c911ac8b264408724710ca (diff) | |
download | Qt-7388fcb83592a90aace054314e0c3e7e7a94fdae.zip Qt-7388fcb83592a90aace054314e0c3e7e7a94fdae.tar.gz Qt-7388fcb83592a90aace054314e0c3e7e7a94fdae.tar.bz2 |
Fix QNetworkConfigurationManager crash due to null private pointer.
Reviewed-by: Aaron McCarthy
Task-Number: QTBUG-17305
Diffstat (limited to 'src/network/bearer')
-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 9927f29..a3b278c 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(); } /*! |