Details
-
Bug
-
Resolution: Invalid
-
P2: Important
-
None
-
5.9.0
-
None
-
macOS 10.12.4
Description
Calling the lookup method on QDnsLookup class, produces a memory leak on macOS. It was inspected with Xcode Instruments Tool and Valgrind, both with similar results.
This simple code can reproduce the problem easily.
#include "dnsresolver.h" DnsResolver::DnsResolver(QObject *parent) : QObject(parent) { lookup = new QDnsLookup(QDnsLookup::A, "qt.io",QHostAddress("8.8.8.8")); connect(lookup, SIGNAL(finished()), this, SLOT(handleLookup())); lookup->lookup(); } void DnsResolver::handleLookup() { // I use sleep for letting the profiler inspect the memory trace with enough time QThread::sleep(10); // I won't use lookup anymore delete lookup; // Let's close the app QCoreApplication::quit(); }
The output of Xcode mem leak result is attached.