From 75891a676262f7f8c46b1ef33a028df199416904 Mon Sep 17 00:00:00 2001 From: peavey Date: Tue, 6 Feb 2007 03:12:51 +0000 Subject: [PATCH] In InspSocket destructor remove any pending timers since the object is now gone. This also fixes bug #202 : m_ident crash. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6514 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspsocket.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp index 08b8f4cd6..d8d4438fe 100644 --- a/src/inspsocket.cpp +++ b/src/inspsocket.cpp @@ -241,7 +241,7 @@ void InspSocket::Close() int save = errno; if (this->fd > -1) { - if (this->IsIOHooked && Instance->Config->GetIOHook(this)) + if (this->IsIOHooked && Instance->Config->GetIOHook(this)) { try { @@ -551,6 +551,11 @@ void InspSocket::OnClose() { return; } InspSocket::~InspSocket() { this->Close(); + if (Timeout) + { + Instance->Timers->DelTimer(Timeout); + Timeout = NULL; + } } void InspSocket::HandleEvent(EventType et, int errornum) -- 2.39.5