summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2006-12-28 13:45:25 +0000
committerpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2006-12-28 13:45:25 +0000
commitd51f650d86d2e6264f69df56f699266545cc06af (patch)
tree4d5327f9a82556d3764c2598c33d7a8397477b9e
parente5100c86bbc15916ef7d89ec17ec45ff87ebdd0f (diff)
Add cleanup of objects on readconf and in destructor.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6132 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/modules/m_dnsbl.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp
index 3d6c419c9..e396c766e 100644
--- a/src/modules/m_dnsbl.cpp
+++ b/src/modules/m_dnsbl.cpp
@@ -184,6 +184,7 @@ class ModuleDNSBL : public Module
virtual ~ModuleDNSBL()
{
+ ClearEntries();
}
virtual Version GetVersion()
@@ -196,13 +197,26 @@ class ModuleDNSBL : public Module
List[I_OnRehash] = List[I_OnUserRegister] = 1;
}
+
+ void ClearEntries()
+ {
+ std::vector<DNSBLConfEntry *>::iterator i, safei;
+ while ((i = DNSBLConfEntries.begin()) != DNSBLConfEntries.end())
+ {
+ DNSBLConfEntries.erase(i);
+ delete *i;
+ }
+
+ }
+
+
/*
* Fill our conf vector with data
*/
virtual void ReadConf()
{
ConfigReader *MyConf = new ConfigReader(ServerInstance);
- DNSBLConfEntries.clear();
+ ClearEntries();
for (int i=0; i< MyConf->Enumerate("dnsbl"); i++)
{