summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-02 00:46:44 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-02 00:46:44 +0000
commit68e47f5ec2154aa97ff298d4516ca0caf746e51a (patch)
tree1c794501bf1cf8212c90075e46875f3e3dd53265
parentae6acab1ba3ddc144c599d5434bbcf6f1efa37ad (diff)
Valgrind cleanup: finish destructor creation
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11615 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--include/bancache.h4
-rw-r--r--include/logger.h6
-rw-r--r--include/timer.h1
-rw-r--r--src/command_parse.cpp3
-rw-r--r--src/dns.cpp7
-rw-r--r--src/timer.cpp6
6 files changed, 26 insertions, 1 deletions
diff --git a/include/bancache.h b/include/bancache.h
index 5bfa2fa3f..1d56decc1 100644
--- a/include/bancache.h
+++ b/include/bancache.h
@@ -100,6 +100,10 @@ class CoreExport BanCacheManager : public classbase
this->ServerInstance = Instance;
this->BanHash = new BanCacheHash();
}
+ ~BanCacheManager()
+ {
+ delete BanHash;
+ }
void RehashCache();
};
diff --git a/include/logger.h b/include/logger.h
index d88706214..d6bd07498 100644
--- a/include/logger.h
+++ b/include/logger.h
@@ -161,6 +161,12 @@ class CoreExport LogManager : public classbase
Logging = false;
}
+ ~LogManager()
+ {
+ if (noforkstream)
+ delete noforkstream;
+ }
+
/** Sets up the logstream for -nofork. Called by InspIRCd::OpenLog() and LogManager::OpenFileLogs().
* First time called it creates the nofork stream and stores it in noforkstream. Each call thereafter just readds it to GlobalLogStreams
* and updates the loglevel.
diff --git a/include/timer.h b/include/timer.h
index 05ce136d2..9c46b4f81 100644
--- a/include/timer.h
+++ b/include/timer.h
@@ -125,6 +125,7 @@ class CoreExport TimerManager
/** Constructor
*/
TimerManager(InspIRCd* Instance);
+ ~TimerManager();
/** Tick all pending Timers
* @param TIME the current system time
diff --git a/src/command_parse.cpp b/src/command_parse.cpp
index 3f8f63c48..efc295e5e 100644
--- a/src/command_parse.cpp
+++ b/src/command_parse.cpp
@@ -436,6 +436,9 @@ void CommandParser::RemoveRFCCommands()
dlclose(c->second);
}
RFCCommands.clear();
+ // special case: reload isn't in the RFCCommands list but is allocated anyway
+ Command* reload = cmdlist.find("RELOAD")->second;
+ delete reload;
}
void CommandParser::RemoveCommand(Commandtable::iterator safei, const char* source)
diff --git a/src/dns.cpp b/src/dns.cpp
index 5af3fd198..4d06e02ab 100644
--- a/src/dns.cpp
+++ b/src/dns.cpp
@@ -129,6 +129,10 @@ class RequestTimeout : public Timer
RequestTimeout(unsigned long n, InspIRCd* SI, DNSRequest* watching, int id) : Timer(n, SI->Time()), ServerInstance(SI), watch(watching), watchid(id)
{
}
+ ~RequestTimeout()
+ {
+ Tick(0);
+ }
void Tick(time_t)
{
@@ -143,7 +147,6 @@ class RequestTimeout : public Timer
}
ServerInstance->Res->requests[watchid] = NULL;
delete watch;
- return;
}
}
};
@@ -876,6 +879,8 @@ DNS::~DNS()
ServerInstance->SE->Shutdown(this, 2);
ServerInstance->SE->Close(this);
ServerInstance->Timers->DelTimer(this->PruneTimer);
+ if (cache)
+ delete cache;
}
CachedQuery* DNS::GetCache(const std::string &source)
diff --git a/src/timer.cpp b/src/timer.cpp
index c58440c88..8dab38392 100644
--- a/src/timer.cpp
+++ b/src/timer.cpp
@@ -20,6 +20,12 @@ TimerManager::TimerManager(InspIRCd* Instance) : ServerInstance(Instance)
{
}
+TimerManager::~TimerManager()
+{
+ for(std::vector<Timer *>::iterator i = Timers.begin(); i != Timers.end(); i++)
+ delete *i;
+}
+
void TimerManager::TickTimers(time_t TIME)
{
while ((Timers.size()) && (TIME > (*Timers.begin())->GetTimer()))