aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorHoward Chu <hyc@symas.com>2017-06-28 22:21:06 +0100
committerHoward Chu <hyc@symas.com>2017-06-28 22:21:06 +0100
commit464afd4d2ddd06f6ed6c0747da83b8dbb338686a (patch)
treee360c062453abd1b17f73c7aeeed5e8dd74f0285 /src/common
parentMerge pull request #2111 (diff)
downloadmonero-464afd4d2ddd06f6ed6c0747da83b8dbb338686a.tar.xz
Ensure DNSResolver destructor runs on exit
Plugs a noisy but benign memory leak
Diffstat (limited to 'src/common')
-rw-r--r--src/common/dns_utils.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/common/dns_utils.cpp b/src/common/dns_utils.cpp
index ab38cbbae..979f34b3e 100644
--- a/src/common/dns_utils.cpp
+++ b/src/common/dns_utils.cpp
@@ -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()