Ensure DNSResolver destructor runs on exit

Plugs a noisy but benign memory leak
This commit is contained in:
Howard Chu 2017-06-28 22:21:06 +01:00
parent 0c6ea4f8a6
commit 464afd4d2d
No known key found for this signature in database
GPG Key ID: FD2A70B44AB11BA7
1 changed files with 2 additions and 6 deletions

View File

@ -307,12 +307,8 @@ DNSResolver& DNSResolver::instance()
{
boost::lock_guard<boost::mutex> lock(instance_lock);
static DNSResolver* staticInstance = NULL;
if (staticInstance == NULL)
{
staticInstance = new DNSResolver();
}
return *staticInstance;
static DNSResolver staticInstance;
return staticInstance;
}
DNSResolver DNSResolver::create()