summaryrefslogtreecommitdiff
path: root/src/mode.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-19 04:09:30 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-19 04:09:30 +0000
commit33141a0825e7cf2dcd0cae63da8943626d8a06b6 (patch)
treeb69c1eb64fc035ac5046a0ca521d8142613d9477 /src/mode.cpp
parent041401bc1fa01d5b1397b20847f8c95b8ea2a4f8 (diff)
Close files opened by configreader
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11915 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/mode.cpp')
-rw-r--r--src/mode.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mode.cpp b/src/mode.cpp
index 47553f238..65a027e90 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -55,13 +55,14 @@ ModeHandler::ModeHandler(Module* Creator, const std::string& Name, char modelett
CullResult ModeHandler::cull()
{
- ServerInstance->Modes->DelMode(this);
+ if (ServerInstance->Modes)
+ ServerInstance->Modes->DelMode(this);
return classbase::cull();
}
ModeHandler::~ModeHandler()
{
- if (ServerInstance && ServerInstance->Modes->FindMode(mode, m_type) == this)
+ if (ServerInstance && ServerInstance->Modes && ServerInstance->Modes->FindMode(mode, m_type) == this)
ServerInstance->Logs->Log("MODE", DEBUG, "ERROR: Destructor for mode %c called while not culled", mode);
}
@@ -1026,7 +1027,7 @@ ModeParser::ModeParser()
ModeParser::~ModeParser()
{
- ModeHandler* mh = ServerInstance->Modes->FindMode('h', MODETYPE_CHANNEL);
+ ModeHandler* mh = FindMode('h', MODETYPE_CHANNEL);
if (mh)
{
mh->cull();