diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-09-26 18:09:52 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-09-26 18:09:52 (GMT) |
commit | 25f856c5719ea903db7d636a54b2145875c1f1ed (patch) | |
tree | 0157ea8b572b5e88e954026a394a0d835d75cb37 | |
parent | 2a41640f3147acf801e5fdc7e6867b6cd93422a3 (diff) | |
parent | 45c2ac4f1e1218f595b1d21691c8dec4eaa1a021 (diff) | |
download | Qt-25f856c5719ea903db7d636a54b2145875c1f1ed.zip Qt-25f856c5719ea903db7d636a54b2145875c1f1ed.tar.gz Qt-25f856c5719ea903db7d636a54b2145875c1f1ed.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1:
QHostInfo: Fix a crash when a new request is pushed while resolving.
-rw-r--r-- | src/network/kernel/qhostinfo.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp index 348b0d2..41a9512 100644 --- a/src/network/kernel/qhostinfo.cpp +++ b/src/network/kernel/qhostinfo.cpp @@ -468,14 +468,17 @@ void QHostInfoRunnable::run() resultEmitter.emitResultsReady(hostInfo); // now also iterate through the postponed ones - QMutableListIterator<QHostInfoRunnable*> iterator(manager->postponedLookups); - while (iterator.hasNext()) { - QHostInfoRunnable* postponed = iterator.next(); - if (toBeLookedUp == postponed->toBeLookedUp) { - // we can now emit - iterator.remove(); - hostInfo.setLookupId(postponed->id); - postponed->resultEmitter.emitResultsReady(hostInfo); + { + QMutexLocker locker(&manager->mutex); + QMutableListIterator<QHostInfoRunnable*> iterator(manager->postponedLookups); + while (iterator.hasNext()) { + QHostInfoRunnable* postponed = iterator.next(); + if (toBeLookedUp == postponed->toBeLookedUp) { + // we can now emit + iterator.remove(); + hostInfo.setLookupId(postponed->id); + postponed->resultEmitter.emitResultsReady(hostInfo); + } } } |