From 6b3c1798e7554dd1ce63b2ad137e327f3f32fcf1 Mon Sep 17 00:00:00 2001 From: Martin Hurton Date: Wed, 10 Feb 2010 12:47:34 +0100 Subject: fq: bugfix - don't read msg from inactive pipe --- src/fq.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/fq.cpp b/src/fq.cpp index e23e302..1836058 100644 --- a/src/fq.cpp +++ b/src/fq.cpp @@ -46,8 +46,11 @@ void zmq::fq_t::detach (reader_t *pipe_) { // Remove the pipe from the list; adjust number of active pipes // accordingly. - if (pipes.index (pipe_) < active) + if (pipes.index (pipe_) < active) { active--; + if (current == active) + current = 0; + } pipes.erase (pipe_); } @@ -55,6 +58,8 @@ void zmq::fq_t::kill (reader_t *pipe_) { // Move the pipe to the list of inactive pipes. active--; + if (current == active) + current = 0; pipes.swap (pipes.index (pipe_), active); } -- cgit v1.2.3