X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fextra%2Fm_pgsql.cpp;h=1e8813e2e48e0eaab968158a6f49596dd8b616be;hb=a94af5f308268cc76fb8c3b59b6443817ba1a8d8;hp=e9179ee24994f1242ae18764163e46737c52c4f3;hpb=2ab88037d8d7d6df3fb9686216a0b36f5ece2313;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/extra/m_pgsql.cpp b/src/modules/extra/m_pgsql.cpp index e9179ee24..1e8813e2e 100644 --- a/src/modules/extra/m_pgsql.cpp +++ b/src/modules/extra/m_pgsql.cpp @@ -2,7 +2,7 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd: (C) 2002-2007 InspIRCd Development Team + * InspIRCd: (C) 2002-2008 InspIRCd Development Team * See: http://www.inspircd.org/wiki/index.php/Credits * * This program is free but copyrighted software; see @@ -22,7 +22,7 @@ #include "m_sqlv2.h" /* $ModDesc: PostgreSQL Service Provider module for all other m_sql* modules, uses v2 of the SQL API */ -/* $CompileFlags: -Wno-variadic-macros -Iexec("pg_config --includedir") eval("my $s = `pg_config --version`;$s =~ /^.*?(\d+)\.(\d+)\.(\d+).*?$/;my $v = hex(sprintf("0x%02x%02x%02x", $1, $2, $3));print "-DPGSQL_HAS_ESCAPECONN" if(($v >= 0x080104) || ($v >= 0x07030F && $v < 0x070400) || ($v >= 0x07040D && $v < 0x080000) || ($v >= 0x080008 && $v < 0x080100));") */ +/* $CompileFlags: -Iexec("pg_config --includedir") eval("my $s = `pg_config --version`;$s =~ /^.*?(\d+)\.(\d+)\.(\d+).*?$/;my $v = hex(sprintf("0x%02x%02x%02x", $1, $2, $3));print "-DPGSQL_HAS_ESCAPECONN" if(($v >= 0x080104) || ($v >= 0x07030F && $v < 0x070400) || ($v >= 0x07040D && $v < 0x080000) || ($v >= 0x080008 && $v < 0x080100));") */ /* $LinkerFlags: -Lexec("pg_config --libdir") -lpq */ /* $ModDep: m_sqlv2.h */ @@ -143,10 +143,10 @@ public: { /* If we allocated these, free them... */ if(fieldlist) - DELETE(fieldlist); + delete fieldlist; if(fieldmap) - DELETE(fieldmap); + delete fieldmap; PQclear(res); } @@ -301,12 +301,12 @@ public: virtual void Free(SQLfieldMap* fm) { - DELETE(fm); + delete fm; } virtual void Free(SQLfieldList* fl) { - DELETE(fl); + delete fl; } }; @@ -737,6 +737,8 @@ class ModulePgSQL : public Module ReadConf(); ServerInstance->Modules->PublishInterface("SQL", this); + Implementation eventlist[] = { I_OnUnloadModule, I_OnRequest, I_OnRehash, I_OnUserRegister, I_OnCheckReady, I_OnUserDisconnect }; + ServerInstance->Modules->Attach(eventlist, this, 6); } virtual ~ModulePgSQL() @@ -750,10 +752,6 @@ class ModulePgSQL : public Module ServerInstance->Modules->DoneWithInterface("SQLutils"); } - void Implements(char* List) - { - List[I_OnUnloadModule] = List[I_OnRequest] = List[I_OnRehash] = List[I_OnUserRegister] = List[I_OnCheckReady] = List[I_OnUserDisconnect] = 1; - } virtual void OnRehash(User* user, const std::string ¶meter) { @@ -860,7 +858,7 @@ class ModulePgSQL : public Module { if (!HostInConf(iter->second->GetConfHost())) { - DELETE(iter->second); + delete iter->second; safei = iter; --iter; connections.erase(safei); @@ -874,7 +872,7 @@ class ModulePgSQL : public Module while ((i = connections.begin()) != connections.end()) { connections.erase(i); - DELETE(i->second); + delete i->second; } } @@ -900,7 +898,7 @@ class ModulePgSQL : public Module { if (conn == iter->second) { - DELETE(iter->second); + delete iter->second; connections.erase(iter); break; }