From b2181cfaacd67d7b080fd8ab5c86a912b95e1ae8 Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Mon, 23 Mar 2009 13:12:19 +0100 Subject: [PATCH] actually reset callbacks in the socket's DoDispose method --- src/node/socket.cc | 13 +++++++++++++ src/node/socket.h | 1 + 2 files changed, 14 insertions(+) diff --git a/src/node/socket.cc b/src/node/socket.cc index 4ceac3962..e13dcf43e 100644 --- a/src/node/socket.cc +++ b/src/node/socket.cc @@ -252,6 +252,19 @@ Socket::NotifyDataRecv (void) } } +void +Socket::DoDispose (void) +{ + + m_connectionSucceeded = MakeNullCallback > (); + m_connectionFailed = MakeNullCallback > (); + m_connectionRequest = MakeNullCallback, const Address &> (); + m_newConnectionCreated = MakeNullCallback, const Address &> (); + m_dataSent = MakeNullCallback, uint32_t> (); + m_sendCb = MakeNullCallback, uint32_t> (); + m_receivedData = MakeNullCallback > (); +} + /*************************************************************** * Socket Tags ***************************************************************/ diff --git a/src/node/socket.h b/src/node/socket.h index caba3627b..fbc4b723c 100644 --- a/src/node/socket.h +++ b/src/node/socket.h @@ -499,6 +499,7 @@ protected: void NotifyDataSent (uint32_t size); void NotifySend (uint32_t spaceAvailable); void NotifyDataRecv (void); + virtual void DoDispose (void); private: Callback > m_connectionSucceeded; Callback > m_connectionFailed;