From 76bd6e73c335dbebd8bd30565f83a810058f2cc8 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Wed, 11 Aug 2010 17:06:49 +0200 Subject: engine termination on disconnect fixed --- src/session.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/session.cpp') diff --git a/src/session.cpp b/src/session.cpp index 0494ff1..e208ebf 100644 --- a/src/session.cpp +++ b/src/session.cpp @@ -49,8 +49,10 @@ zmq::session_t::~session_t () void zmq::session_t::terminate () { - // TODO: - zmq_assert (false); + if (in_pipe) + in_pipe->terminate (); + if (out_pipe) + out_pipe->terminate (); } bool zmq::session_t::read (::zmq_msg_t *msg_) @@ -228,6 +230,14 @@ void zmq::session_t::process_attach (i_engine *engine_, attached (peer_identity_); } +void zmq::session_t::detach () +{ + // Engine is dead. Let's forget about it. + engine = NULL; + + detached (); +} + void zmq::session_t::process_term () { // Here we are pugging into the own_t's termination mechanism. -- cgit v1.2.3