diff options
author | Howard Chu <hyc@symas.com> | 2017-06-28 22:21:06 +0100 |
---|---|---|
committer | Howard Chu <hyc@symas.com> | 2017-06-28 22:21:06 +0100 |
commit | 464afd4d2ddd06f6ed6c0747da83b8dbb338686a (patch) | |
tree | e360c062453abd1b17f73c7aeeed5e8dd74f0285 /src/common | |
parent | Merge pull request #2111 (diff) | |
download | monero-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.cpp | 8 |
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() |