summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorspecial <special@e03df62e-2008-0410-955e-edbf42e46eb7>2006-10-11 07:46:04 +0000
committerspecial <special@e03df62e-2008-0410-955e-edbf42e46eb7>2006-10-11 07:46:04 +0000
commitef70178ea465aebe7c5318496d4bde89f867bc3b (patch)
tree4eb3c591a118ca7b1b36e5097ba1604d0469efa8
parent9f36316d730c7b4457a5625ca8012ead11bd9482 (diff)
Fixed a crash when unloading m_safelist (timers weren't properly tracked to be deleted). Someone should seriously consider rewriting this module, or at least seriously overhauling it
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5460 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/modules/m_safelist.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/modules/m_safelist.cpp b/src/modules/m_safelist.cpp
index 32e68ff10..11976f91c 100644
--- a/src/modules/m_safelist.cpp
+++ b/src/modules/m_safelist.cpp
@@ -41,6 +41,7 @@ class ListData : public classbase
typedef std::vector<userrec *> UserList;
UserList listusers; /* vector of people doing a /list */
+class ListTimer *timer;
/** To create a timer which recurs every second, we inherit from InspTimer.
* InspTimer is only one-shot however, so at the end of each Tick() we simply
@@ -135,26 +136,24 @@ class ListTimer : public InspTimer
}
}
- ListTimer* MyTimer = new ListTimer(ServerInstance,1);
- ServerInstance->Timers->AddTimer(MyTimer);
+ timer = new ListTimer(ServerInstance,1);
+ ServerInstance->Timers->AddTimer(timer);
}
};
class ModuleSafeList : public Module
{
private:
-
- ListTimer* MyTimer;
public:
ModuleSafeList(InspIRCd* Me) : Module::Module(Me)
{
- MyTimer = new ListTimer(ServerInstance,1);
- ServerInstance->Timers->AddTimer(MyTimer);
+ timer = new ListTimer(ServerInstance,1);
+ ServerInstance->Timers->AddTimer(timer);
}
virtual ~ModuleSafeList()
{
- ServerInstance->Timers->DelTimer(MyTimer);
+ ServerInstance->Timers->DelTimer(timer);
}
virtual Version GetVersion()