summaryrefslogtreecommitdiff
path: root/src/dns.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-09-14 19:31:22 -0400
committerAdam <Adam@anope.org>2010-09-14 19:31:22 -0400
commit6239b5a053fc8fd94b798495f8e189a2e2bda285 (patch)
treedcebc7977510969cbbcafafd98010c531256f0d2 /src/dns.cpp
parente7ac33fd622ae6e21bc9af684832b7de5cfa0c0c (diff)
Give DNS requests an error when their creator is being unloaded instead of just deleting them, and fixed a compile warning
Diffstat (limited to 'src/dns.cpp')
-rw-r--r--src/dns.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dns.cpp b/src/dns.cpp
index 7b96cf660..ebed29b5e 100644
--- a/src/dns.cpp
+++ b/src/dns.cpp
@@ -7,7 +7,7 @@ static inline unsigned short GetRandomID()
return random();
}
-DNSRequest::DNSRequest(const Anope::string &addr, QueryType qt, bool cache, Module *c) : address(addr), QT(qt), creator(c)
+DNSRequest::DNSRequest(const Anope::string &addr, QueryType qt, bool cache, Module *c) : creator(c), address(addr), QT(qt)
{
if (!DNSEngine)
DNSEngine = new DNSManager();
@@ -541,6 +541,7 @@ void DNSManager::Cleanup(Module *mod)
if (req->creator && req->creator == mod)
{
+ req->OnError(DNS_ERROR_UNLOADED, "Module is being unloaded");
delete req;
this->requests.erase(id);
}