restart timer in QHostInfoCache::put() instead of recreating it

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2021-09-15 19:39:24 +03:00
parent 01f49cca22
commit 61f4bb5e9f

View file

@ -427,8 +427,7 @@ void QHostInfoCache::put(const QString &name, const QHostInfo &info)
QHostInfoCacheElement* element = new QHostInfoCacheElement();
element->info = info;
element->age = QElapsedTimer();
element->age.start();
element->age.restart();
QMutexLocker locker(&this->mutex);
cache.insert(name, element); // cache will take ownership