summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorom <om@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-09 13:21:58 +0000
committerom <om@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-09 13:21:58 +0000
commit2a8b31f79701ed4211aabee26764622c50c9f3bd (patch)
tree2d33be054d7d19576c2bf4d8082f411e3df484d3
parent19d57d3a32c8872c867c57f9fc37f2779824fcec (diff)
Move to stack-allocated OnRehash()-local ConfigReader *duck*
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4210 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/modules/m_chanprotect.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/modules/m_chanprotect.cpp b/src/modules/m_chanprotect.cpp
index a3926e73b..899903c09 100644
--- a/src/modules/m_chanprotect.cpp
+++ b/src/modules/m_chanprotect.cpp
@@ -172,7 +172,6 @@ class ModuleChanProtect : public Module
{
Server *Srv;
bool FirstInGetsFounder;
- ConfigReader *Conf;
ChanProtect* cp;
ChanFounder* cf;
@@ -181,7 +180,6 @@ class ModuleChanProtect : public Module
ModuleChanProtect(Server* Me) : Module::Module(Me), Srv(Me)
{
/* Initialise module variables */
- Conf = new ConfigReader;
cp = new ChanProtect(Me);
cf = new ChanFounder(Me);
@@ -219,11 +217,14 @@ class ModuleChanProtect : public Module
virtual void OnRehash(const std::string &parameter)
{
- // on a rehash we delete our classes for good measure and create them again.
- DELETE(Conf);
- Conf = new ConfigReader;
- // re-read our config options on a rehash
- FirstInGetsFounder = Conf->ReadFlag("options","noservices",0);
+ /* Create a configreader class and read our flag,
+ * in old versions this was heap-allocated and the
+ * object was kept between rehashes...now we just
+ * stack-allocate it locally.
+ */
+ ConfigReader Conf;
+
+ FirstInGetsFounder = Conf.ReadFlag("options","noservices",0);
}
virtual void OnUserJoin(userrec* user, chanrec* channel)
@@ -336,7 +337,6 @@ class ModuleChanProtect : public Module
virtual ~ModuleChanProtect()
{
- DELETE(Conf);
DELETE(cp);
DELETE(cf);
}