]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
delete operator tracking in debug mode (using a macro -- live with it.)
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 24 Apr 2006 13:28:07 +0000 (13:28 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 24 Apr 2006 13:28:07 +0000 (13:28 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3904 e03df62e-2008-0410-955e-edbf42e46eb7

49 files changed:
include/inspircd.h
src/channels.cpp
src/cmd_kill.cpp
src/cmd_quit.cpp
src/dns.cpp
src/dnsqueue.cpp
src/helperfuncs.cpp
src/inspircd.cpp
src/mode.cpp
src/modules.cpp
src/modules/extra/m_filter_pcre.cpp
src/modules/extra/m_sql.cpp
src/modules/extra/m_sqlauth.cpp
src/modules/extra/m_sqllog.cpp
src/modules/extra/m_sqloper.cpp
src/modules/extra/m_ssl_gnutls.cpp
src/modules/extra/m_ssl_openssl.cpp
src/modules/m_alias.cpp
src/modules/m_blockamsg.cpp
src/modules/m_censor.cpp
src/modules/m_chanfilter.cpp
src/modules/m_chanprotect.cpp
src/modules/m_conn_waitpong.cpp
src/modules/m_denychans.cpp
src/modules/m_filter.cpp
src/modules/m_helpop.cpp
src/modules/m_hostchange.cpp
src/modules/m_ident.cpp
src/modules/m_joinflood.cpp
src/modules/m_kicknorejoin.cpp
src/modules/m_messageflood.cpp
src/modules/m_operjoin.cpp
src/modules/m_operlevels.cpp
src/modules/m_opermodes.cpp
src/modules/m_opermotd.cpp
src/modules/m_override.cpp
src/modules/m_park.cpp
src/modules/m_randquote.cpp
src/modules/m_restrictchans.cpp
src/modules/m_safelist.cpp
src/modules/m_silence.cpp
src/modules/m_spanningtree.cpp
src/modules/m_swhois.cpp
src/modules/m_timedbans.cpp
src/modules/m_vhost.cpp
src/timer.cpp
src/userprocess.cpp
src/users.cpp
src/xline.cpp

index ecd09964bf2fcead4a55a0d19a8636f6e71b6de8..3acd1b30fec851a70de22b6b5ff1a7d73002a26a 100644 (file)
@@ -42,6 +42,8 @@
  */
 #define IS_SINGLE(x,y) ( (*x == y) && (*(x+1) == 0) )
 
+#define DELETE(x) { log(DEBUG,__FILE__" ("__LINE__"): delete()"); delete x; }
+
 template<typename T> inline std::string ConvToStr(const T &in)
 {
        std::stringstream tmp;
index f07ad01bde27c0420c58a5b239a6a43380035d9a..61d82a451fa948a2ba67e6632ac62c3fb8ec6f6c 100644 (file)
@@ -414,7 +414,7 @@ chanrec* add_channel(userrec *user, const char* cn, const char* key, bool overri
                if (n != chanlist.end())
                {
                        Ptr->DelUser(user);
-                       delete Ptr;
+                       DELETE(Ptr);
                        chanlist.erase(n);
                        for (unsigned int index =0; index < user->chans.size(); index++)
                        {
@@ -529,7 +529,7 @@ chanrec* del_channel(userrec *user, const char* cname, const char* reason, bool
                {
                        log(DEBUG,"del_channel: destroyed: %s",Ptr->name);
                        FOREACH_MOD(I_OnChannelDelete,OnChannelDelete(Ptr));
-                       delete Ptr;
+                       DELETE(Ptr);
                        chanlist.erase(iter);
                }
        }
@@ -579,8 +579,8 @@ void server_kick_channel(userrec* user, chanrec* Ptr, char* reason, bool trigger
                if (iter != chanlist.end())
                {
                        log(DEBUG,"del_channel: destroyed: %s",Ptr->name);
-                       FOREACH_MOD(I_OnChannelDelete,OnChannelDelete(Ptr));
-                       delete Ptr;
+                       FOREACH_MOD(I_OnChannelDelete,OnChannelDelete(Ptr));
+                       DELETE(Ptr);
                        chanlist.erase(iter);
                }
        }
@@ -665,7 +665,7 @@ void kick_channel(userrec *src,userrec *user, chanrec *Ptr, char* reason)
                {
                        log(DEBUG,"del_channel: destroyed: %s",Ptr->name);
                        FOREACH_MOD(I_OnChannelDelete,OnChannelDelete(Ptr));
-                       delete Ptr;
+                       DELETE(Ptr);
                        chanlist.erase(iter);
                }
        }
index 82bba06e390c23db06bdea49b972a586c85bb76d..432970a0c345afea4bf28bc0815a05b321356d0b 100644 (file)
@@ -70,7 +70,7 @@ void cmd_kill::Handle (char **parameters, int pcnt, userrec *user)
                                purge_empty_chans(u);
                        }
 
-                       delete u;
+                       DELETE(u);
                }
                else
                {
index ff559ee7e7a5d0d8d5ed5a6bf3d6d0d5fdabaa6e..7c0b602e9464ea52c9d4004be7efba1ac0839a25 100644 (file)
@@ -117,5 +117,5 @@ void cmd_quit::Handle (char **parameters, int pcnt, userrec *user)
        }
        if (user->fd > -1)
                fd_ref_table[user->fd] = NULL;
-       delete user;
+       DELETE(user);
 }
index bdb7889a56899a381eabe057a3ca10580cd5baa8..1da703c70a7bae94894f90f230b32714eaf49f4d 100644 (file)
@@ -285,7 +285,7 @@ s_connection *dns_add_query(s_header *h)
        }
        if (s->fd == -1)
        {
-               delete s;
+               DELETE(s);
                return NULL;
        }
        /* create new connection object, add to linked list */
@@ -352,7 +352,7 @@ in_addr* DNS::dns_aton4_r(const char *ipstring) { /* ascii to numeric (reentrant
        ip = new in_addr;
        if(dns_aton4_s(ipstring,ip) == NULL)
        {
-               delete ip;
+               DELETE(ip);
                return NULL;
        }
        return ip;
@@ -479,38 +479,38 @@ char* DNS::dns_getresult_s(const int cfd, char *res) { /* retrieve result of DNS
        dns_close(c->fd);
        if (l < 12)
        {
-               delete c;
+               DELETE(c);
                return NULL;
        }
        dns_fill_header(&h,buffer,l - 12);
        if (c->id[0] != h.id[0] || c->id[1] != h.id[1])
        {
                log(DEBUG,"DNS: id mismatch on query");
-               delete c;
+               DELETE(c);
                return NULL; /* ID mismatch */
        }
        if ((h.flags1 & FLAGS1_MASK_QR) == 0)
        {
                log(DEBUG,"DNS: didnt get a query result");
-               delete c;
+               DELETE(c);
                return NULL;
        }
        if ((h.flags1 & FLAGS1_MASK_OPCODE) != 0)
        {
                log(DEBUG,"DNS: got an OPCODE and didnt want one");
-               delete c;
+               DELETE(c);
                return NULL;
        }
        if ((h.flags2 & FLAGS2_MASK_RCODE) != 0)
        {
                log(DEBUG,"DNS lookup failed due to SERVFAIL");
-               delete c;
+               DELETE(c);
                return NULL;
        }
        if (h.ancount < 1)
        {
                log(DEBUG,"DNS: no answers!");
-               delete c;
+               DELETE(c);
                return NULL;
        }
        i = 0;
@@ -556,7 +556,7 @@ char* DNS::dns_getresult_s(const int cfd, char *res) { /* retrieve result of DNS
                }
                if (l - i < 10)
                {
-                       delete c;
+                       DELETE(c);
                        return NULL;
                }
                dns_fill_rr(&rr,&h.payload[i]);
@@ -627,7 +627,7 @@ char* DNS::dns_getresult_s(const int cfd, char *res) { /* retrieve result of DNS
                                                break;
                                        if (rr.rdlength != 4)
                                        {
-                                               delete c;
+                                               DELETE(c);
                                                return NULL;
                                        }
                                        memcpy(&alist->ip,&h.payload[i],4);
@@ -654,7 +654,7 @@ char* DNS::dns_getresult_s(const int cfd, char *res) { /* retrieve result of DNS
                                        }
                                        if (l - i < 10)
                                        {
-                                               delete c;
+                                               DELETE(c);
                                                return NULL;
                                        }
                                        dns_fill_rr(&rr,&h.payload[i]);
@@ -674,7 +674,7 @@ char* DNS::dns_getresult_s(const int cfd, char *res) { /* retrieve result of DNS
                        res[rr.rdlength] = '\0';
                        break;
        }
-       delete c;
+       DELETE(c);
        return res;
 }
 
index 73d80d11d02804b3fc526979d49dc7e560a7dc60..fee15febd56749c153081dc338a4215c224e8ba7 100644 (file)
@@ -247,7 +247,7 @@ void dns_poll(int fdcheck)
                                 * from the socket engine, as dns.cpp tracks it
                                 * for us if we are in single-threaded country.
                                 */
-                               delete x;
+                               DELETE(x);
                        }
                }
                else
@@ -255,7 +255,7 @@ void dns_poll(int fdcheck)
                        /* its fd is dodgy, the dns code probably
                         * bashed it due to error. Free the class.
                         */
-                       delete x;
+                       DELETE(x);
                }
                /* If we got down here, the dns lookup was valid, BUT,
                 * its still in progress. Be patient, and wait for
index 354e16bc9e73cc70b3ff4263bf709f4a3ee57245..13716b78b42b21b1a5e95ebb9bc3820229ae2555 100644 (file)
@@ -1229,7 +1229,7 @@ void purge_empty_chans(userrec* u)
                if (i2 != chanlist.end())
                {
                        FOREACH_MOD(I_OnChannelDelete,OnChannelDelete(i2->second));
-                       delete i2->second;
+                       DELETE(i2->second);
                        chanlist.erase(i2);
                }
        }
index 5e437365be0f3a3e8d74c5057bce24517e7f341f..777cc595f5e85d7d0d5f643bad9484a8b5d297db 100644 (file)
@@ -372,7 +372,7 @@ void InspIRCd::erase_module(int j)
        {
                if (v1 == j)
                {
-                       delete *m;
+                       DELETE(*m);
                        modules.erase(m);
                        modules.push_back(NULL);
                        break;
@@ -817,7 +817,7 @@ void InspIRCd::DoOneIteration(bool process_module_sockets)
                                                }
                                        }
                                        s->Close();
-                                       delete s;
+                                       DELETE(s);
                                }
                                else if (!s)
                                {
@@ -947,7 +947,7 @@ int main(int argc, char** argv)
        {
                ServerInstance = new InspIRCd(argc, argv);
                ServerInstance->Run();
-               delete ServerInstance;
+               DELETE(ServerInstance);
        }
        catch (std::bad_alloc)
        {
index 3842b01e6ea02301b5d3b86e2221d89948dd1409..d2ecbf369ad0ae03cc80d5d512b8a0f4a33be8d2 100644 (file)
@@ -1293,7 +1293,7 @@ bool ModeParser::ProcessModuleUmode(char umode, userrec* source, void* dest, boo
                log(DEBUG,"No module claims umode %c",umode);
                if (faked)
                {
-                       delete s2;
+                       DELETE(s2);
                        source = NULL;
                }
                return false;
@@ -1302,7 +1302,7 @@ bool ModeParser::ProcessModuleUmode(char umode, userrec* source, void* dest, boo
        {
                if (faked)
                {
-                       delete s2;
+                       DELETE(s2);
                        source = NULL;
                }
                return false;
index 223b1fe3001b46fba98b630d72d94a5862c79213..ab49859fec13c49ae9bdbcbaae4fafbb0f4567a3 100644 (file)
@@ -870,9 +870,9 @@ ConfigReader::~ConfigReader()
        //~ if (this->cache)
                //~ delete this->cache;
        if (this->errorlog)
-               delete this->errorlog;
+               DELETE(this->errorlog);
        if(this->privatehash)
-               delete this->data;
+               DELETE(this->data);
 }
 
 
index 267fc71b4dbefc1235b8922d962170b5e233c632..58ca77333d3dae0af2f8cd0078ef18bae6e89f61 100644 (file)
@@ -91,8 +91,8 @@ class ModuleFilterPCRE : public Module
        
        virtual ~ModuleFilterPCRE()
        {
-               delete MyConf;
-               delete Conf;
+               DELETE(MyConf);
+               DELETE(Conf);
        }
 
        void Implements(char* List)
@@ -156,8 +156,8 @@ class ModuleFilterPCRE : public Module
        {
                // reload our config file on rehash - we must destroy and re-allocate the classes
                // to call the constructor again and re-read our data.
-               delete Conf;
-               delete MyConf;
+               DELETE(Conf);
+               DELETE(MyConf);
                Conf = new ConfigReader;
                std::string filterfile = Conf->ReadValue("filter","file",0);
                // this automatically re-reads the configuration file into the class
index ef3fbf21d54a8cdd49a687d43e3b4d243908155e..1c5da9366df2dd39f294a5c325b9251ddc0d91f2 100644 (file)
@@ -333,12 +333,12 @@ class ModuleSQL : public Module
        virtual ~ModuleSQL()
        {
                Connections.clear();
-               delete Conf;
+               DELETE(Conf);
        }
        
        virtual void OnRehash(const std::string &parameter)
        {
-               delete Conf;
+               DELETE(Conf);
                Conf = new ConfigReader();
                LoadDatabases(Conf);
        }
index d5ccc20d79e9a7a2a77330e360fa4a41e3a3dc88..f27c0c28b0b0e35d069cc265e25b9621a485bb65 100644 (file)
@@ -68,7 +68,7 @@ class ModuleSQLAuth : public Module
                {
                        encryption.append("(");
                }
-               delete Conf;
+               DELETE(Conf);
                SQLModule = Srv->FindModule("m_sql.so");
                if (!SQLModule)
                        Srv->Log(DEFAULT,"WARNING: m_sqlauth.so could not initialize because m_sql.so is not loaded. Load the module and rehash your server.");
@@ -170,8 +170,8 @@ class ModuleSQLAuth : public Module
                                found = false;
                        }
                        
-                       delete rowrequest;
-                       delete rowresult;
+                       DELETE(rowrequest);
+                       DELETE(rowresult);
                }
                else
                {
@@ -185,8 +185,8 @@ class ModuleSQLAuth : public Module
                Request donerequest((char*)query, this, SQLModule);
                donerequest.Send();
                
-               delete query;
-               delete result;
+               DELETE(query);
+               DELETE(result);
                
                return found;
        }
index 845c3e0d982f3a00fd6bef9c7934246dd3d757c0..84dd8fa4344a34c14e9fe98164e028ec296dc17e 100644 (file)
@@ -50,7 +50,7 @@ class ModuleSQLLog : public Module
        {
                Conf = new ConfigReader();
                dbid = Conf->ReadInteger("sqllog","dbid",0,true);       // database id of a database configured in m_sql (see m_sql config)
-               delete Conf;
+               DELETE(Conf);
                SQLModule = Srv->FindModule("m_sql.so");
                if (!SQLModule)
                        Srv->Log(DEFAULT,"WARNING: m_SQLLog.so could not initialize because m_sql.so is not loaded. Load the module and rehash your server.");
@@ -92,18 +92,18 @@ class ModuleSQLLog : public Module
                        if (rowresult->GetType() == SQL_ROW)
                        {
                                nid = atoi(rowresult->GetField("id").c_str());
-                               delete rowresult;
+                               DELETE(rowresult);
                        }
                        
-                       delete rowrequest;
-                       delete result;
+                       DELETE(rowrequest);
+                       DELETE(result);
                }
                
                query->SetQueryType(SQL_DONE);
                query->SetConnID(dbid);
                Request donerequest((char*)query, this, SQLModule);
                donerequest.Send();
-               delete query;
+               DELETE(query);
                
                if (nid < 1)
                {
@@ -117,9 +117,9 @@ class ModuleSQLLog : public Module
                        }
                        
                        if (result2)
-                               delete result;
+                               DELETE(result);
                        if (query2)
-                               delete query2;
+                               DELETE(query2);
                                
                        nid = InsertNick(nick);
                }
@@ -141,9 +141,9 @@ class ModuleSQLLog : public Module
                }
                
                if (result)
-                       delete result;
+                       DELETE(result);
                if (query)
-                       delete query;
+                       DELETE(query);
                        
                return;
        }
@@ -165,18 +165,18 @@ class ModuleSQLLog : public Module
                        if (rowresult->GetType() == SQL_ROW)
                        {
                                hid = atoi(rowresult->GetField("id").c_str());
-                               delete rowresult;
+                               DELETE(rowresult);
                        }
                        
-                       delete rowrequest;
-                       delete result;
+                       DELETE(rowrequest);
+                       DELETE(result);
                }
                
                query->SetQueryType(SQL_DONE);
                query->SetConnID(dbid);
                Request donerequest((char*)query, this, SQLModule);
                donerequest.Send();
-               delete query;
+               DELETE(query);
                
                if (hid < 1)
                {
@@ -190,9 +190,9 @@ class ModuleSQLLog : public Module
                        }
                        
                        if (result)
-                               delete result2;
+                               DELETE(result2);
                        if (query)
-                               delete query2;
+                               DELETE(query2);
                        hid = InsertHost(host);
                }
                
index 5a039d0693721de6ea4d0b526c67959c32b2c116..8707f1580a4153a92d0c28e3ead518ea78462922 100644 (file)
@@ -72,7 +72,7 @@ class ModuleSQLOper : public Module
 
        virtual void OnRehash(const std::string &parameter)
        {
-               delete Conf;
+               DELETE(Conf);
                Conf = new ConfigReader();
                ReadConfig();
        }
@@ -186,7 +186,7 @@ class ModuleSQLOper : public Module
                                        }
                                }
                                
-                               delete rowresult;
+                               DELETE(rowresult);
                        }
                        else
                        {
@@ -194,8 +194,8 @@ class ModuleSQLOper : public Module
                                found = false;
                        }
                        
-                       delete rowrequest;
-                       delete result;
+                       DELETE(rowrequest);
+                       DELETE(result);
                }
                else
                {
@@ -206,13 +206,13 @@ class ModuleSQLOper : public Module
                query->SetConnID(dbid);
                Request donerequest((char*)query, this, SQLModule);
                donerequest.Send();
-               delete query;
+               DELETE(query);
                return found;
        }
 
        virtual ~ModuleSQLOper()
        {
-               delete Conf;
+               DELETE(Conf);
        }
        
        virtual Version GetVersion()
index 52209d44ce5b0d76e580c9ef86f1621eb717136e..5be9e7bcc24d40c2c563256947805dd9849a07bd 100644 (file)
@@ -174,7 +174,7 @@ class ModuleSSLGnuTLS : public Module
                // This may be on a large (once a day or week) timer eventually.
                GenerateDHParams();
                
-               delete Conf;
+               DELETE(Conf);
        }
        
        void GenerateDHParams()
@@ -564,8 +564,8 @@ class ModuleSSLGnuTLS : public Module
                        metadata->push_back("ON");              // The value to send
                        Event* event = new Event((char*)metadata,(Module*)this,"send_metadata");
                        event->Send();                          // Trigger the event. We don't care what module picks it up.
-                       delete event;
-                       delete metadata;
+                       DELETE(event);
+                       DELETE(metadata);
                }
        }
        
index 1e20b1ccf226d52fa84d15925bbe0fbd2826034e..b1d8af21cdb6dac9fd877461e781f968ed3bf938 100644 (file)
@@ -210,7 +210,7 @@ class ModuleSSLOpenSSL : public Module
                        log(DEFAULT, "m_ssl_openssl.so: Couldn't set DH parameters");
                }
 
-               delete Conf;
+               DELETE(Conf);
        }
 
        virtual ~ModuleSSLOpenSSL()
@@ -628,8 +628,8 @@ class ModuleSSLOpenSSL : public Module
                        metadata->push_back("ON");              // The value to send
                        Event* event = new Event((char*)metadata,(Module*)this,"send_metadata");
                        event->Send();                          // Trigger the event. We don't care what module picks it up.
-                       delete event;
-                       delete metadata;
+                       DELETE(event);
+                       DELETE(metadata);
                }
        }
        
index 80b55e0a4ab911b90a92b02cde7457d52fd355f4..bd6c001b36e8e6d12305abe8215c5e5ea9f45e02 100644 (file)
@@ -79,7 +79,7 @@ class ModuleAlias : public Module
        
                virtual ~ModuleAlias()
                {
-                       delete MyConf;
+                       DELETE(MyConf);
                }
        
                virtual Version GetVersion()
@@ -150,7 +150,7 @@ class ModuleAlias : public Module
   
                virtual void OnRehash(const std::string &parameter)
                {
-                       delete MyConf;
+                       DELETE(MyConf);
                        MyConf = new ConfigReader;
                
                        ReadAliases();
index 95dfa40c4fe185dad891455a0a8e6c924baf7c89..0472e2417efbbeac8d3bafffe6a718eb001b82c1 100644 (file)
@@ -91,7 +91,7 @@ public:
                else
                        action = IBLOCK_KILLOPERS;
 
-               delete Conf;
+               DELETE(Conf);
        }
 
        virtual int OnPreCommand(const std::string &command, char **parameters, int pcnt, userrec *user, bool validated)
@@ -171,7 +171,7 @@ public:
                        BlockedMessage* m = (BlockedMessage*)user->GetExt("amsgblock");
                        if(m)
                        {
-                               delete m;
+                               DELETE(m);
                                user->Shrink("amsgblock");
                        }
                }
index ee1a6342495aa566a9c70e003bc2bc8e673259f8..6a5acb54cb275db09c6a197bbaefb05e75289b13 100644 (file)
@@ -164,8 +164,8 @@ class ModuleCensor : public Module
                        irc::string replace = (MyConf->ReadValue("badword","replace",index)).c_str();
                        censors[pattern] = replace;
                }
-               delete Conf;
-               delete MyConf;
+               DELETE(Conf);
+               DELETE(MyConf);
        }
        
        virtual Version GetVersion()
index 9e8d36ff8bd345e087db469863d32963cf907d85..b9fe2225fd44dc8bdd56c670420c59936131da59 100644 (file)
@@ -67,14 +67,14 @@ class ModuleChanFilter : public Module
                        if (spamlist)
                        {
                                channel->Shrink("spam_list");
-                               delete spamlist;
+                               DELETE(spamlist);
                        }
                }
        }
 
        virtual void OnRehash(const std::string &parameter)
        {
-               delete Conf;
+               DELETE(Conf);
                Conf = new ConfigReader;
                // re-read our config options on a rehash
                MaxEntries = Conf->ReadInteger("chanfilter","maxsize",0,true);
@@ -195,7 +195,7 @@ class ModuleChanFilter : public Module
        
        virtual ~ModuleChanFilter()
        {
-               delete Conf;
+               DELETE(Conf);
        }
        
        virtual Version GetVersion()
index b6f277c0379030acd324e8bb7a63a79f6c5f6f8e..0839a48e41e42f718d2c5770ff14e818b33c296b 100644 (file)
@@ -81,7 +81,7 @@ 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;
+               DELETE(Conf);
                Conf = new ConfigReader;
                // re-read our config options on a rehash
                FirstInGetsFounder = Conf->ReadFlag("options","noservices",0);
@@ -318,7 +318,7 @@ class ModuleChanProtect : public Module
        
        virtual ~ModuleChanProtect()
        {
-               delete Conf;
+               DELETE(Conf);
        }
        
        virtual Version GetVersion()
index f67021af5d7ab493c7d665f218dea602354af4f1..804026adbae8c4de193747be55b07d70c972d02f 100644 (file)
@@ -21,7 +21,7 @@ char* RandString(unsigned int length)
        
        out[length] = '\0';
        
-       delete tmp;
+       DELETE(tmp);
        
        return (char*)out;
 }
@@ -56,7 +56,7 @@ class ModuleWaitPong : public Module
                if(Conf->GetError() == CONF_VALUE_NOT_FOUND)
                        killonbadreply = true;
                                
-               delete Conf;
+               DELETE(Conf);
        }
 
        void Implements(char* List)
@@ -86,7 +86,7 @@ class ModuleWaitPong : public Module
                        {
                                if(strcmp(pingrpl, parameters[0]) == 0)
                                {
-                                       delete pingrpl;
+                                       DELETE(pingrpl);
                                        user->Shrink("waitpong_pingstr");
                                        return 1;
                                }
@@ -113,7 +113,7 @@ class ModuleWaitPong : public Module
 
                if(pingrpl)
                {
-                       delete pingrpl;
+                       DELETE(pingrpl);
                        user->Shrink("waitpong_pingstr");
                }
        }
@@ -127,7 +127,7 @@ class ModuleWaitPong : public Module
                        
                        if(pingrpl)
                        {
-                               delete pingrpl;
+                               DELETE(pingrpl);
                                user->Shrink("waitpong_pingstr");
                        } 
                }
index cfa96e2b3064b965faee04f87e6f3afa6039a641..67e4da607ffe0aed672f7e81708cf653fc62c2eb 100644 (file)
@@ -38,13 +38,13 @@ class ModuleDenyChannels : public Module
        
        virtual void OnRehash(const std::string &param)
        {
-               delete Conf;
+               DELETE(Conf);
                Conf = new ConfigReader;
        }
        
        virtual ~ModuleDenyChannels()
        {
-               delete Conf;
+               DELETE(Conf);
        }
        
        virtual Version GetVersion()
index 929ae64565b8d9155df091ba4a05f64e1aaaf0e8..d183ce2f72d5c46ae0e49d1d58bac593570f861a 100644 (file)
@@ -140,7 +140,7 @@ class ModuleFilter : public Module
                }
                for (filter_t::iterator n = filters.begin(); n != filters.end(); n++)
                {
-                       delete n->second;
+                       DELETE(n->second);
                }
                filters.clear();
                for (int index = 0; index < MyConf->Enumerate("keyword"); index++)
@@ -156,8 +156,8 @@ class ModuleFilter : public Module
                        filters[pattern] = x;
                }
                Srv->Log(DEFAULT,std::string("m_filter: read configuration from ")+filterfile);
-               delete Conf;
-               delete MyConf;
+               DELETE(Conf);
+               DELETE(MyConf);
        }
        
        virtual Version GetVersion()
index 966f645d390e570d3a339789fa5f09b6e11936b5..b6c723ca79e1cd126a1054d90cc1d39322497bf5 100644 (file)
@@ -216,9 +216,9 @@ class ModuleHelpop : public Module
 
                virtual void OnRehash(const std::string &parameter)
                {
-                       delete conf;
+                       DELETE(conf);
                        if (helpop)
-                               delete helpop;
+                               DELETE(helpop);
 
                        ReadConfig();
                }
@@ -242,8 +242,8 @@ class ModuleHelpop : public Module
 
                virtual ~ModuleHelpop()
                {
-                       delete conf;
-                       delete helpop;
+                       DELETE(conf);
+                       DELETE(helpop);
                }
        
                virtual Version GetVersion()
index a4a5a8b08db6ff24446dadd42b56a88a4da5aef2..21333a853e27cf8c5de6654f15f5a95a324d9563 100644 (file)
@@ -52,7 +52,7 @@ class ModuleHostChange : public Module
        
        virtual ~ModuleHostChange()
        {
-               delete Conf;
+               DELETE(Conf);
        }
 
        Priority Prioritize()
@@ -67,12 +67,12 @@ class ModuleHostChange : public Module
 
        virtual void OnRehash(const std::string &parameter)
        {
-               delete Conf;
+               DELETE(Conf);
                Conf = new ConfigReader;
                MySuffix = Conf->ReadValue("host","suffix",0);
                for (hostchanges_t::iterator i = hostchanges.begin(); i != hostchanges.end(); i++)
                {
-                       delete i->second;
+                       DELETE(i->second);
                }
                hostchanges.clear();
                for (int index = 0; index < Conf->Enumerate("hostchange"); index++)
index 9136d1349dcf2d765b24a2de7df554269e29c83a..2669c9254214f2de384d3c8767feb47ad38a1324 100644 (file)
@@ -149,7 +149,7 @@ class ModuleIdent : public Module
                IdentTimeout = Conf->ReadInteger("ident","timeout",0,true);
                if (!IdentTimeout)
                        IdentTimeout = 1;
-               delete Conf;
+               DELETE(Conf);
        }
 
        ModuleIdent(Server* Me)
@@ -187,7 +187,7 @@ class ModuleIdent : public Module
                else
                {
                        Srv->SendServ(user->fd,"NOTICE "+std::string(user->nick)+" :*** Could not find your ident, using "+std::string(user->ident)+" instead.");
-                       delete ident;
+                       DELETE(ident);
                }
        }
 
index b1dc5c657c0dc751b910eac78c8ba3f1943d0a2a..ae31ab67c9e3f566fdd8b49d25581a9bace00a8c 100644 (file)
@@ -165,7 +165,7 @@ class ModuleJoinFlood : public Module
                                if (c->GetExt("joinflood"))
                                {
                                        joinfloodsettings *f = (joinfloodsettings*)c->GetExt("joinflood");
-                                       delete f;
+                                       DELETE(f);
                                        c->Shrink("joinflood");
                                }
                        }
@@ -211,7 +211,7 @@ class ModuleJoinFlood : public Module
                if (chan->GetExt("joinflood"))
                {
                        joinfloodsettings *f = (joinfloodsettings*)chan->GetExt("joinflood");
-                       delete f;
+                       DELETE(f);
                        chan->Shrink("joinflood");
                }
        }
index 18fd995ad201ad6870eedbf0eec5315c74f49861..3910bc0307aac3abc9304d109ee6b9f9a38bcd74 100644 (file)
@@ -46,7 +46,7 @@ public:
                                
                                if (dl)
                                {
-                                       delete dl;
+                                       DELETE(dl);
                                        c->Shrink("norejoinusers");
                                }
                        }
@@ -95,38 +95,38 @@ public:
                                if (!dl->size())
                                {
                                        // Now it's empty..
-                                       delete dl;
-                                       chan->Shrink("norejoinusers");
+                                               DELETE(dl);
+                                               chan->Shrink("norejoinusers");
+                                       }
                                }
                        }
+                       return 0;
                }
-               return 0;
-       }
-       
-       virtual void OnUserKick(userrec* source, userrec* user, chanrec* chan, const std::string &reason)
-       {
-               if (chan->IsModeSet('J') && (source != user))
+               
+               virtual void OnUserKick(userrec* source, userrec* user, chanrec* chan, const std::string &reason)
                {
-                       delaylist* dl = (delaylist*)chan->GetExt("norejoinusers");
-                       
-                       if (!dl)
+                       if (chan->IsModeSet('J') && (source != user))
                        {
-                               dl = new delaylist;
-                               chan->Extend("norejoinusers", (char*)dl);
+                               delaylist* dl = (delaylist*)chan->GetExt("norejoinusers");
+                               
+                               if (!dl)
+                               {
+                                       dl = new delaylist;
+                                       chan->Extend("norejoinusers", (char*)dl);
+                               }
+                               
+                               log(DEBUG, "m_kicknorejoin.so: setting record for %s, %d second delay", user->nick, strtoint(chan->GetModeParameter('J')));
+                               (*dl)[user] = time(NULL) + strtoint(chan->GetModeParameter('J'));
                        }
-                       
-                       log(DEBUG, "m_kicknorejoin.so: setting record for %s, %d second delay", user->nick, strtoint(chan->GetModeParameter('J')));
-                       (*dl)[user] = time(NULL) + strtoint(chan->GetModeParameter('J'));
                }
-       }
-       
-       virtual void OnChannelDelete(chanrec* chan)
-       {
-               delaylist* dl = (delaylist*)chan->GetExt("norejoinusers");
                
-               if (dl)
+               virtual void OnChannelDelete(chanrec* chan)
                {
-                       delete dl;
+                       delaylist* dl = (delaylist*)chan->GetExt("norejoinusers");
+                       
+                       if (dl)
+                       {
+                               DELETE(dl);
                        chan->Shrink("norejoinusers");
                }
        }
index 61682c26f87ae95c8d6649b389436866e39d3466..c5df268ea896ad5953ee90b09cd46d60350d5ce9 100644 (file)
@@ -163,7 +163,7 @@ class ModuleMsgFlood : public Module
                                if (c->GetExt("flood"))
                                {
                                        floodsettings *f = (floodsettings*)c->GetExt("flood");
-                                       delete f;
+                                       DELETE(f);
                                        c->Shrink("flood");
                                }
                        }
@@ -219,7 +219,7 @@ class ModuleMsgFlood : public Module
                if (chan->GetExt("flood"))
                {
                        floodsettings *f = (floodsettings*)chan->GetExt("flood");
-                       delete f;
+                       DELETE(f);
                        chan->Shrink("flood");
                }
        }
index 2517b385f8fa6b0a51e956bce16d33330bc55677..c334009544c103e00256fa3f8aa097caae68fdbe 100644 (file)
@@ -32,13 +32,13 @@ class ModuleOperjoin : public Module
 
                virtual void OnRehash(const std::string &parameter)
                {
-                       delete conf;
+                       DELETE(conf);
                        conf = new ConfigReader;
                }
 
                virtual ~ModuleOperjoin()
                {
-                       delete conf;
+                       DELETE(conf);
                }
 
                virtual Version GetVersion()
index 306dbe5878450d754b693c3c1dfaa19060f2f7c7..8df45f0fcf807fd9c65121555554fd68aa90776d 100644 (file)
@@ -28,7 +28,7 @@ class ModuleOperLevels : public Module
 
                virtual ~ModuleOperLevels()
                {
-                       delete conf;
+                       DELETE(conf);
                }
 
                void Implements(char* List)
@@ -38,7 +38,7 @@ class ModuleOperLevels : public Module
 
                virtual void OnRehash(const std::string &parameter)
                {
-                       delete conf;
+                       DELETE(conf);
                        conf = new ConfigReader;
                }
 
index 6bf823d319eaccd91389c67c57ce70bc6b2094f4..c46b8beafd8ba2456bf08999bb567cc3e888e67f 100644 (file)
@@ -45,13 +45,13 @@ class ModuleModesOnOper : public Module
 
        virtual void OnRehash(const std::string &parameter)
        {
-               delete Conf;
+               DELETE(Conf);
                Conf = new ConfigReader;
        }
        
        virtual ~ModuleModesOnOper()
        {
-               delete Conf;
+               DELETE(Conf);
        }
        
        virtual Version GetVersion()
index c43775db8dab3d2b7050b49006e3c73b982e79ef..5f9dafa655917a22101d62592dbd95b27e19b289 100644 (file)
@@ -21,7 +21,7 @@ void LoadOperMOTD()
        filename = conf->ReadValue("opermotd","file",0);
 
        opermotd->LoadFile(filename);
-       delete conf;
+       DELETE(conf);
 }
 
 void ShowOperMOTD(userrec* user)
index 16c3a529579cb978afe2c76ea090dc3b73c74aca..64ce9cff6285b32a953ab502fd327cd0a7cc3e1d 100644 (file)
@@ -58,7 +58,7 @@ class ModuleOverride : public Module
                        overrides[typen] = tokenlist;
                }
                
-               delete Conf;
+               DELETE(Conf);
        }
 
        void Implements(char* List)
index 935efa39c7f2f559d55ba6aa122c524963bd389a..7abe31bafd08a78e89f2b5ed98dbdeca86d21cbb 100644 (file)
@@ -176,7 +176,7 @@ class cmd_unpark : public command_t
                                timebuf[strlen(timebuf)-1] = '\0';
                                WriteServ(unpark->fd,"NOTICE %s :From %s at %s: \2%s\2",unpark->nick,i->from.c_str(),timebuf,i->text.c_str());
                        }
-                       delete awy;
+                       DELETE(awy);
                        unpark->Shrink("park_awaylog");
                        unpark->Shrink("park_key");
                        for (parkinfo::iterator j = pinfo.begin(); j != pinfo.end(); j++)
@@ -209,7 +209,7 @@ class ModulePark : public Module
                ParkMaxTime = Conf->ReadInteger("park","maxtime",0,true);
                ConcurrentParks = Conf->ReadInteger("park","maxperip",0,true);
                ParkMaxMsgs = Conf->ReadInteger("park","maxmessages",0,true);
-               delete Conf;
+               DELETE(Conf);
        }
 
        ModulePark(Server* Me)
index a3b4c4a7e4d6a5e34668bbe3a7600ba2631cf849..64c967ae81edb691105bf52190bb8e2a0ebe906a 100644 (file)
@@ -122,8 +122,8 @@ class ModuleRandQuote : public Module
        
        virtual ~ModuleRandQuote()
        {
-               delete conf;
-               delete quotes;
+               DELETE(conf);
+               DELETE(quotes);
        }
        
        virtual Version GetVersion()
index cd94ba3feab17a7fc9abbfc34419534f13848486..a901dfde6a4dd9c6816ea22c3b907ffa115ed175 100644 (file)
@@ -42,7 +42,7 @@ class ModuleRestrictChans : public Module
                        irc::string channel = txt.c_str();
                        allowchans[channel] = 1;
                }
-               delete MyConf;
+               DELETE(MyConf);
        }
 
  public:
index e9ea965f93c52f10dd13554ef3c73582e035b6a0..0ba1f28a1d1b815c59ba2e79e7e3cdcd21c68e59 100644 (file)
@@ -80,7 +80,7 @@ class ListTimer : public InspTimer
                                if (ld->list_position > Srv->GetChannelCount())
                                {
                                        u->Shrink("safelist_cache");
-                                       delete ld;
+                                       DELETE(ld);
                                        listusers.erase(iter);
                                        go_again = true;
                                        break;
@@ -202,7 +202,7 @@ class ModuleSafeList : public Module
                                return 1;
                        }
 
-                       delete last_list_time;
+                       DELETE(last_list_time);
                        user->Shrink("safelist_last");
                }
  
@@ -229,7 +229,7 @@ class ModuleSafeList : public Module
                        if (ld)
                        {
                                u->Shrink("safelist_cache");
-                               delete ld;
+                               DELETE(ld);
                        }
                        for (UserList::iterator iter = listusers.begin(); iter != listusers.end(); iter++)
                        {
@@ -243,7 +243,7 @@ class ModuleSafeList : public Module
                        time_t* last_list_time = (time_t*)u->GetExt("safelist_last");
                        if (last_list_time)
                        {
-                               delete last_list_time;
+                               DELETE(last_list_time);
                                u->Shrink("safelist_last");
                        }
                }
index 4beda442365f63230d11b5cb5bb201d7d32923b3..dea78c5268f74d4eb6c4e988ef985301786aee1d 100644 (file)
@@ -91,7 +91,7 @@ class cmd_silence : public command_t
                                        {
                                                // tidy up -- if a user's list is empty, theres no use having it
                                                // hanging around in the user record.
-                                               delete sl;
+                                               DELETE(sl);
                                                user->Shrink("silence_list");
                                        }
                                }
@@ -153,7 +153,7 @@ class ModuleSilence : public Module
                silencelist* sl = (silencelist*)user->GetExt("silence_list");
                if (sl)
                {
-                       delete sl;
+                       DELETE(sl);
                        user->Shrink("silence_list");
                }
        }
index eb4db133579b14a407d8063f4ba55e7c98d91afe..c36005fb2afe3da62726b8469d3d9dd8ded16f7c 100644 (file)
@@ -455,7 +455,7 @@ class TreeServer
                                TreeServer* s = (TreeServer*)*a;
                                s->Tidy();
                                Children.erase(a);
-                               delete s;
+                               DELETE(s);
                                stillchildren = true;
                                break;
                        }
@@ -658,9 +658,9 @@ class TreeSocket : public InspSocket
        ~TreeSocket()
        {
                if (ctx_in)
-                       delete ctx_in;
+                       DELETE(ctx_in);
                if (ctx_out)
-                       delete ctx_out;
+                       DELETE(ctx_out);
        }
 
        void InitAES(std::string key,std::string SName)
@@ -887,7 +887,7 @@ class TreeSocket : public InspSocket
                        SquitServer(from, Current);
                        Current->Tidy();
                        Current->GetParent()->DelChild(Current);
-                       delete Current;
+                       DELETE(Current);
                        WriteOpers("Netsplit complete, lost \002%d\002 users on \002%d\002 servers.", num_lost_users, num_lost_servers);
                }
                else
@@ -911,7 +911,7 @@ class TreeSocket : public InspSocket
                }
                Srv->SendMode(modelist,params.size(),who);
                DoOneToAllButSender(source,"FMODE",params,source);
-               delete who;
+               DELETE(who);
                return true;
        }
 
@@ -2839,7 +2839,7 @@ void ReadConfiguration(bool rebind)
                                {
                                        log(DEFAULT,"m_spanningtree: Warning: Failed to bind server port %d",Port);
                                        listener->Close();
-                                       delete listener;
+                                       DELETE(listener);
                                }
                        }
                }
@@ -2889,7 +2889,7 @@ void ReadConfiguration(bool rebind)
                        }
                }
        }
-       delete Conf;
+       DELETE(Conf);
 }
 
 
@@ -3229,7 +3229,7 @@ class ModuleSpanningTree : public Module
                                        else
                                        {
                                                WriteOpers("*** AUTOCONNECT: Error autoconnecting \002%s\002: %s.",x->Name.c_str(),strerror(errno));
-                                               delete newsocket;
+                                               DELETE(newsocket);
                                        }
                                }
                        }
@@ -3291,7 +3291,7 @@ class ModuleSpanningTree : public Module
                                        else
                                        {
                                                WriteServ(user->fd,"NOTICE %s :*** CONNECT: Error connecting \002%s\002: %s.",user->nick,x->Name.c_str(),strerror(errno));
-                                               delete newsocket;
+                                               DELETE(newsocket);
                                        }
                                        return 1;
                                }
index a4d94710216b1667acc121381a4fa191ae97d9ea..98ed007d0ae2dc497e5fe3448461f20aab57ef66 100644 (file)
@@ -56,7 +56,7 @@ class cmd_swhois : public command_t
                                        WriteOpers("*** %s used SWHOIS to set %s's extra whois from '%s' to '%s'", user->nick, dest->nick, text->c_str(), line.c_str());
                                
                                dest->Shrink("swhois");
-                               delete text;
+                               DELETE(text);
                        }
                        else if(!Srv->IsUlined(user->server))
                        {
@@ -87,7 +87,7 @@ class ModuleSWhois : public Module
 
        void OnRehash(const std::string &parameter)
        {
-               delete Conf;
+               DELETE(Conf);
                Conf = new ConfigReader();
        }
 
@@ -138,7 +138,7 @@ class ModuleSWhois : public Module
                {
                        std::string* swhois = (std::string*)field;
                        user->Shrink("swhois");
-                       delete swhois;
+                       DELETE(swhois);
                }
        }
 
@@ -153,7 +153,7 @@ class ModuleSWhois : public Module
                        {
                                std::string* swhois = (std::string*)field;
                                user->Shrink("swhois");
-                               delete swhois;
+                               DELETE(swhois);
                        }
                }
        }
@@ -195,7 +195,7 @@ class ModuleSWhois : public Module
                                        if(std::string* old = (std::string*)user->GetExt("swhois"))
                                        {
                                                user->Shrink("swhois");
-                                               delete old;
+                                               DELETE(old);
                                        }
                        
                                        std::string* text = new std::string(swhois);
@@ -209,7 +209,7 @@ class ModuleSWhois : public Module
        
        virtual ~ModuleSWhois()
        {
-               delete Conf;
+               DELETE(Conf);
        }
        
        virtual Version GetVersion()
index 98a76ad630d6577c939b36566070002216e1bb4e..b1b0de25f7ebaac3292f818e01d209ad4f9bbefa 100644 (file)
@@ -170,7 +170,7 @@ class ModuleTimedBans : public Module
                                                temp->fd = FD_MAGIC_NUMBER;
                                                temp->server = "";
                                                Srv->SendMode(setban,3,temp);
-                                               delete temp;
+                                               DELETE(temp);
                                        }
                                        // we used to delete the item here, but we dont need to as the servermode above does it for us,
                                        break;
index a2e77f09176d5235eb0c203abc955da23481df94..f419772d4d0f2d90754ad274d9224294469565ad 100644 (file)
@@ -72,7 +72,7 @@ class ModuleVHost : public Module
        
        virtual ~ModuleVHost()
        {
-               delete Conf;
+               DELETE(Conf);
        }
 
        void Implements(char* List)
@@ -82,7 +82,7 @@ class ModuleVHost : public Module
 
        virtual void OnRehash(const std::string &parameter)
        {
-               delete Conf;
+               DELETE(Conf);
                Conf = new ConfigReader;
        }
        
index 6ccdbb9bd7cacb2c1661f94c6f07e820937a83a0..f35a9c67be4acc39b5d8a992bc131eaba667495c 100644 (file)
@@ -41,11 +41,11 @@ void TickTimers(time_t TIME)
                {
                        InspTimer* n = *y;
                        n->Tick(TIME);
-                       delete n;
+                       DELETE(n);
                }
 
                Timers.erase(found);
-               delete x;
+               DELETE(x);
        }
 }
 
@@ -69,11 +69,11 @@ void TickMissedTimers(time_t TIME)
                        {
                                InspTimer* z = *y;
                                z->Tick(TIME);
-                               delete z;
+                               DELETE(z);
                        }
 
                        Timers.erase(found);
-                       delete x;
+                       DELETE(x);
                }
        }
 }
index 2adccc36e5f419d1e1515f1f8b8b3aa08314c76c..e9860b5947a38f90bd829db79df88da07cc863af 100644 (file)
@@ -324,7 +324,7 @@ void DoSocketTimeouts(time_t TIME)
                        SE->DelFd(s->GetFd());
                        module_sockets.erase(a);
                        s->Close();
-                       delete s;
+                       DELETE(s);
                        break;
                }
 
index d4919af06305d7c483b58912c946cf167145f299..41f1f097c23efcbef079202bc274a2353af999d1 100644 (file)
@@ -139,7 +139,7 @@ userrec::~userrec()
        for (std::vector<ucrec*>::iterator n = chans.begin(); n != chans.end(); n++)
        {
                ucrec* x = (ucrec*)*n;
-               delete x;
+               DELETE(x);
        }
 }
 
@@ -543,7 +543,7 @@ void kill_link(userrec *user,const char* r)
                        }
                }
                clientlist.erase(iter);
-               delete user;
+               DELETE(user);
        }
 }
 
@@ -587,7 +587,7 @@ void AddWhoWas(userrec* u)
                if (group->size() > 10)
                {
                        WhoWasGroup *a = (WhoWasGroup*)*(group->begin());
-                       delete a;
+                       DELETE(a);
                        group->pop_front();
                }
                
@@ -607,7 +607,7 @@ void MaintainWhoWas(time_t TIME)
                        while ((n->begin() != n->end()) && ((*n->begin())->signon < TIME - 259200)) // 3 days
                        {
                                WhoWasGroup *a = *(n->begin());
-                               delete a;
+                               DELETE(a);
                                n->erase(n->begin());
                        }
                }
@@ -634,7 +634,7 @@ void AddClient(int socket, int port, bool iscached, in_addr ip4)
        if (iter != clientlist.end())
        {
                userrec* goner = iter->second;
-               delete goner;
+               DELETE(goner);
                clientlist.erase(iter);
        }
 
index 86a6081f226ca2878c793f3043d30210145ca03a..0443a4f17d56c19f394596a1fa6f587a0ddc31e9 100644 (file)
@@ -711,7 +711,7 @@ void apply_lines(const int What)
        }
 
        Goners->Apply();
-       delete Goners;
+       DELETE(Goners);
 }
 
 void stats_k(userrec* user)