1
0
mirror of https://github.com/anope/anope.git synced 2026-07-01 00:46:38 +02:00

Give DNS requests an error when their creator is being unloaded instead of just deleting them, and fixed a compile warning

This commit is contained in:
Adam
2010-09-14 19:31:22 -04:00
parent e7ac33fd62
commit 6239b5a053
2 changed files with 3 additions and 1 deletions
+2 -1
View File
@@ -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);
}