From 486a4bb77ce26fe69529e579464f494e619d1922 Mon Sep 17 00:00:00 2001 From: w00t Date: Mon, 4 May 2009 20:27:54 +0000 Subject: Fix unnecessary heap allocation on rehash: stack allocated ConfigReader is fine. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11359 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_override.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/modules/m_override.cpp b/src/modules/m_override.cpp index a1e78812d..8f0b0aa2d 100644 --- a/src/modules/m_override.cpp +++ b/src/modules/m_override.cpp @@ -48,22 +48,20 @@ class ModuleOverride : public Module virtual void OnRehash(User* user, const std::string ¶meter) { // on a rehash we delete our classes for good measure and create them again. - ConfigReader* Conf = new ConfigReader(ServerInstance); + ConfigReader Conf(ServerInstance); // re-read our config options on a rehash - NoisyOverride = Conf->ReadFlag("override", "noisy", 0); - RequireKey = Conf->ReadFlag("override", "requirekey", 0); + NoisyOverride = Conf.ReadFlag("override", "noisy", 0); + RequireKey = Conf.ReadFlag("override", "requirekey", 0); overrides.clear(); - for (int j =0; j < Conf->Enumerate("type"); j++) + for (int j =0; j < Conf.Enumerate("type"); j++) { - std::string typen = Conf->ReadValue("type","name",j); - std::string tokenlist = Conf->ReadValue("type","override",j); + std::string typen = Conf.ReadValue("type","name",j); + std::string tokenlist = Conf.ReadValue("type","override",j); overrides[typen] = tokenlist; } - - delete Conf; } -- cgit v1.2.3