From 45f83d78a56f4b3a812c87fec03a75558445b2ab Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Thu, 12 Aug 2010 15:03:51 +0200 Subject: one more dezombification bug fixed --- src/socket_base.hpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/socket_base.hpp') diff --git a/src/socket_base.hpp b/src/socket_base.hpp index 785967e..1d8c4ff 100644 --- a/src/socket_base.hpp +++ b/src/socket_base.hpp @@ -85,8 +85,8 @@ namespace zmq void terminated (class writer_t *pipe_); // This function should be called only on zombie sockets. It tries - // to deallocate the zombie. - void dezombify (); + // to deallocate the zombie. Returns true is object is destroyed. + bool dezombify (); protected: @@ -120,6 +120,9 @@ namespace zmq // by overloading it. void process_term (); + // Delay actual destruction of the socket. + void process_destroy (); + private: // TODO: Check whether we still need this flag... @@ -128,6 +131,11 @@ namespace zmq // attached to the socket. bool zombie; + // If true, object should have been already destroyed. However, + // destruction is delayed while we unwind the stack to the point + // where it doesn't intersect the object being destroyed. + bool destroyed; + // Check whether transport protocol, as specified in connect or // bind, is available and compatible with the socket type. int check_protocol (const std::string &protocol_); -- cgit v1.2.3