From 2a8b31f79701ed4211aabee26764622c50c9f3bd Mon Sep 17 00:00:00 2001 From: om Date: Sun, 9 Jul 2006 13:21:58 +0000 Subject: [PATCH] Move to stack-allocated OnRehash()-local ConfigReader *duck* git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4210 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_chanprotect.cpp | 16 ++++++++-------- 1 file 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 ¶meter) { - // 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); } -- 2.39.5