summaryrefslogtreecommitdiff
path: root/src/mode.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-13 21:34:29 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-13 21:34:29 +0000
commit37fd031da06761c8a050105b55d73a8ab499fb74 (patch)
tree6709b8882806cfe2a4dd20bdcd0aa5581344955e /src/mode.cpp
parent99064f734b9b1513c1d3b3792d6ea8102aae26e1 (diff)
Remove Command and ModeHandler objects in their destructors; fixes possible pointer leak if a module was not careful when triggering exceptions in its constructor
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11872 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/mode.cpp')
-rw-r--r--src/mode.cpp17
1 files changed, 1 insertions, 16 deletions
diff --git a/src/mode.cpp b/src/mode.cpp
index c37407223..1ac2b9e64 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -57,6 +57,7 @@ ModeHandler::ModeHandler(Module* Creator, const std::string& Name, char modelett
ModeHandler::~ModeHandler()
{
+ ServerInstance->Modes->DelMode(this);
}
bool ModeHandler::IsListMode()
@@ -690,22 +691,6 @@ bool ModeParser::DelMode(ModeHandler* mh)
return true;
}
-void ModeParser::RemoveModes(Module* mod)
-{
- for(int i=0; i < 256; i++)
- {
- ModeHandler* mh = modehandlers[i];
- if (mh && mh->creator == mod)
- DelMode(mh);
- for(unsigned int j=0; j < modewatchers[i].size(); j++)
- {
- ModeWatcher* mw = modewatchers[i][j];
- if (mw && mw->creator == mod)
- DelModeWatcher(mw);
- }
- }
-}
-
ModeHandler* ModeParser::FindMode(unsigned const char modeletter, ModeType mt)
{
unsigned char mask = 0;