From 23e803f104d59503dc2a37e458eb4daedc44ccfc Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Thu, 25 Aug 2016 18:01:50 +0200 Subject: m_spanningtree Handle unload in resolvers --- src/modules/m_spanningtree/resolvers.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/modules/m_spanningtree/resolvers.cpp b/src/modules/m_spanningtree/resolvers.cpp index 6682b8dbe..1228e375f 100644 --- a/src/modules/m_spanningtree/resolvers.cpp +++ b/src/modules/m_spanningtree/resolvers.cpp @@ -73,7 +73,12 @@ void ServernameResolver::OnLookupComplete(const DNS::Query *r) void ServernameResolver::OnError(const DNS::Query *r) { - /* Ooops! */ + if (r->error == DNS::ERROR_UNLOADED) + { + // We're being unloaded, skip the snotice and ConnectServer() below to prevent autoconnect creating new sockets + return; + } + if (query == DNS::QUERY_AAAA) { ServernameResolver* snr = new ServernameResolver(this->manager, host, MyLink, DNS::QUERY_A, myautoconnect); @@ -115,6 +120,7 @@ void SecurityIPResolver::OnLookupComplete(const DNS::Query *r) void SecurityIPResolver::OnError(const DNS::Query *r) { + // This can be called because of us being unloaded but we don't have to do anything differently if (query == DNS::QUERY_AAAA) { SecurityIPResolver* res = new SecurityIPResolver(mine, this->manager, host, MyLink, DNS::QUERY_A); -- cgit v1.2.3