summaryrefslogtreecommitdiff
path: root/src/modules/m_conn_waitpong.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_conn_waitpong.cpp')
-rw-r--r--src/modules/m_conn_waitpong.cpp17
1 files changed, 16 insertions, 1 deletions
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()
{
}