From 2dcb3efcc37c499c01d8fafe1bce985bc39449bf Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Sun, 25 Sep 2011 03:50:05 +0700 Subject: [PATCH] Fix OnClientDisconnect() hook of network modules. It wasn't called for them. --- Client.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Client.cpp b/Client.cpp index 33c8ca6c..1dcf4622 100644 --- a/Client.cpp +++ b/Client.cpp @@ -189,7 +189,6 @@ void CClient::ReadLine(const CString& sData) { // Block PONGs, we already responded to the pings return; } else if (sCommand.Equals("QUIT")) { - SetNetwork(NULL, true, false); Close(Csock::CLT_AFTERWRITE); // Treat a client quit as a detach return; // Don't forward this msg. We don't want the client getting us disconnected. } else if (sCommand.Equals("PROTOCTL")) { @@ -657,10 +656,11 @@ void CClient::ConnectionRefused() { void CClient::Disconnected() { DEBUG(GetSockName() << " == Disconnected()"); + CIRCNetwork* pNetwork = m_pNetwork; SetNetwork(NULL, true, false); if (m_pUser) { - NETWORKMODULECALL(OnClientDisconnect(), m_pUser, m_pNetwork, this, NOTHING); + NETWORKMODULECALL(OnClientDisconnect(), m_pUser, pNetwork, this, NOTHING); } }