aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-08-07 14:46:26 +0200
committerRiccardo Spagni <ric@spagni.net>2017-08-07 14:46:26 +0200
commit159a6e96690dfc4f7ff92aa7628ac19a704bbc5f (patch)
treee8620845025d2a99e87bf3310dda92023aca36ad
parentMerge pull request #2159 (diff)
parentEnsure DNSResolver destructor runs on exit (diff)
downloadmonero-159a6e96690dfc4f7ff92aa7628ac19a704bbc5f.tar.xz
Merge pull request #2132
464afd4d Ensure DNSResolver destructor runs on exit (Howard Chu)
-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()