From 33141a0825e7cf2dcd0cae63da8943626d8a06b6 Mon Sep 17 00:00:00 2001 From: danieldg Date: Mon, 19 Oct 2009 04:09:30 +0000 Subject: Close files opened by configreader git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11915 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/mode.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/mode.cpp') 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(); -- cgit v1.2.3