2
0
mirror of https://github.com/inspircd/inspircd.git synced 2025-03-21 16:39:02 -04:00

Move to stack-allocated OnRehash()-local ConfigReader *duck*

git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4210 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
om 2006-07-09 13:21:58 +00:00
parent 19d57d3a32
commit 2a8b31f797

@ -172,7 +172,6 @@ class ModuleChanProtect : public Module
{ {
Server *Srv; Server *Srv;
bool FirstInGetsFounder; bool FirstInGetsFounder;
ConfigReader *Conf;
ChanProtect* cp; ChanProtect* cp;
ChanFounder* cf; ChanFounder* cf;
@ -181,7 +180,6 @@ class ModuleChanProtect : public Module
ModuleChanProtect(Server* Me) : Module::Module(Me), Srv(Me) ModuleChanProtect(Server* Me) : Module::Module(Me), Srv(Me)
{ {
/* Initialise module variables */ /* Initialise module variables */
Conf = new ConfigReader;
cp = new ChanProtect(Me); cp = new ChanProtect(Me);
cf = new ChanFounder(Me); cf = new ChanFounder(Me);
@ -219,11 +217,14 @@ class ModuleChanProtect : public Module
virtual void OnRehash(const std::string &parameter) virtual void OnRehash(const std::string &parameter)
{ {
// on a rehash we delete our classes for good measure and create them again. /* Create a configreader class and read our flag,
DELETE(Conf); * in old versions this was heap-allocated and the
Conf = new ConfigReader; * object was kept between rehashes...now we just
// re-read our config options on a rehash * stack-allocate it locally.
FirstInGetsFounder = Conf->ReadFlag("options","noservices",0); */
ConfigReader Conf;
FirstInGetsFounder = Conf.ReadFlag("options","noservices",0);
} }
virtual void OnUserJoin(userrec* user, chanrec* channel) virtual void OnUserJoin(userrec* user, chanrec* channel)
@ -336,7 +337,6 @@ class ModuleChanProtect : public Module
virtual ~ModuleChanProtect() virtual ~ModuleChanProtect()
{ {
DELETE(Conf);
DELETE(cp); DELETE(cp);
DELETE(cf); DELETE(cf);
} }