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:
+2
-1
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user