summaryrefslogtreecommitdiffstats
path: root/src/network/kernel/qhostinfo.cpp
diff options
context:
space:
mode:
authorMarkus Goetz <Markus.Goetz@nokia.com>2010-04-26 12:33:05 (GMT)
committerMarkus Goetz <Markus.Goetz@nokia.com>2010-05-05 11:37:12 (GMT)
commit95a69f37ec156a2506b140e5e349bb7f68e112a5 (patch)
tree8d254b25c7fbef5780a6e1f1daa67a45f6cce3a5 /src/network/kernel/qhostinfo.cpp
parent6b02a101cb96dee4bc574ebec1f91c9243f278fb (diff)
downloadQt-95a69f37ec156a2506b140e5e349bb7f68e112a5.zip
Qt-95a69f37ec156a2506b140e5e349bb7f68e112a5.tar.gz
Qt-95a69f37ec156a2506b140e5e349bb7f68e112a5.tar.bz2
QHostInfo: Immediately delete aborted lookup requests.
Reviewed-by: Thiago
Diffstat (limited to 'src/network/kernel/qhostinfo.cpp')
-rw-r--r--src/network/kernel/qhostinfo.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp
index f287630..fd39347 100644
--- a/src/network/kernel/qhostinfo.cpp
+++ b/src/network/kernel/qhostinfo.cpp
@@ -596,6 +596,23 @@ void QHostInfoLookupManager::abortLookup(int id)
return;
QMutexLocker locker(&this->mutex);
+
+ // is postponed? delete and return
+ for (int i = 0; i < postponedLookups.length(); i++) {
+ if (postponedLookups.at(i)->id == id) {
+ delete postponedLookups.takeAt(i);
+ return;
+ }
+ }
+
+ // is scheduled? delete and return
+ for (int i = 0; i < scheduledLookups.length(); i++) {
+ if (scheduledLookups.at(i)->id == id) {
+ delete scheduledLookups.takeAt(i);
+ return;
+ }
+ }
+
if (!abortedLookups.contains(id))
abortedLookups.append(id);
}