QHostInfo::abortLookup: ignore -1

The id -1 is the one of a default-constructed QHostInfo (invalid).
It's also returned by various codepaths to mean a lookup failure.
Attemping to abort its lookup should simply be ignored.

Change-Id: I0413dd248a890f57195e4f5b5baea011b6737102
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
Giuseppe D'Angelo 2023-09-04 20:14:21 +02:00
parent 55f0738f16
commit f18082bbed
1 changed files with 3 additions and 0 deletions

View File

@ -998,6 +998,9 @@ void QHostInfoLookupManager::abortLookup(int id)
if (wasDeleted)
return;
if (id == -1)
return;
#if QT_CONFIG(thread)
// is postponed? delete and return
for (int i = 0; i < postponedLookups.size(); i++) {