Commit babdf48a authored by Dhammika Pathirana's avatar Dhammika Pathirana Committed by Martin Sustrik

Fix pipe writer termination

Signed-off-by: 's avatarDhammika Pathirana <dhammika@gmail.com>
parent 8e0049e2
...@@ -275,6 +275,7 @@ void zmq::writer_t::terminate () ...@@ -275,6 +275,7 @@ void zmq::writer_t::terminate ()
// Prevent double termination. // Prevent double termination.
if (terminating) if (terminating)
return; return;
terminating = true;
// Mark the pipe as not available for writing. // Mark the pipe as not available for writing.
active = false; active = false;
...@@ -339,7 +340,7 @@ void zmq::writer_t::process_activate_writer (uint64_t msgs_read_) ...@@ -339,7 +340,7 @@ void zmq::writer_t::process_activate_writer (uint64_t msgs_read_)
// If the writer was non-active before, let's make it active // If the writer was non-active before, let's make it active
// (available for writing messages to). // (available for writing messages to).
if (!active) { if (!active && !terminating) {
active = true; active = true;
zmq_assert (sink); zmq_assert (sink);
sink->activated (this); sink->activated (this);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment