diff -r 81c69049bdab src/internet-stack/tcp-socket-impl.cc --- a/src/internet-stack/tcp-socket-impl.cc Fri Sep 03 09:56:51 2010 +0100 +++ b/src/internet-stack/tcp-socket-impl.cc Fri Sep 17 14:52:41 2010 -0400 @@ -782,8 +782,10 @@ * and then zero our member varible on general principles. */ m_endPoint->SetDestroyCallback(MakeNullCallback()); - m_tcp->DeAllocate (m_endPoint); + // Changed this to zero the member variable BEFORE calling DeAllocate, as sometimes deallocating the endpoint would eventually lead to our own destructor being called (via reference counting). -gmaslov + Ipv4EndPoint* endPoint = m_endPoint; m_endPoint = 0; + m_tcp->DeAllocate (endPoint); CancelAllTimers(); }