mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-12 20:19:02 -04:00
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
This commit is contained in:
parent
9f36316d73
commit
ef70178ea4
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user