From 74c6e4d21cb2566be749db330679fe34376ef69a Mon Sep 17 00:00:00 2001 From: om Date: Fri, 27 Jan 2006 17:52:08 +0000 Subject: Add OnCleanup (every little helps! :p) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2941 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_conn_waitpong.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/modules') diff --git a/src/modules/m_conn_waitpong.cpp b/src/modules/m_conn_waitpong.cpp index 245182536..a32487f58 100644 --- a/src/modules/m_conn_waitpong.cpp +++ b/src/modules/m_conn_waitpong.cpp @@ -62,7 +62,7 @@ class ModuleWaitPong : public Module void Implements(char* List) { - List[I_OnUserRegister] = List[I_OnCheckReady] = List[I_OnPreCommand] = List[I_OnRehash] = List[I_OnUserDisconnect] = 1; + List[I_OnUserRegister] = List[I_OnCheckReady] = List[I_OnPreCommand] = List[I_OnRehash] = List[I_OnUserDisconnect] = List[I_OnCleanup] = 1; } virtual void OnUserRegister(userrec* user) @@ -116,6 +116,21 @@ class ModuleWaitPong : public Module } } + virtual void OnCleanup(int target_type, void* item) + { + if(target_type == TYPE_USER) + { + userrec* user = (userrec*)item; + std::string* pingrpl = (std::string*)user->GetExt("waitpong_pingstr"); + + if(pingrpl) + { + delete pingrpl; + user->Shrink("waitpong_pingstr"); + } + } + } + virtual ~ModuleWaitPong() { } -- cgit v1.2.3