Commit 10120214 authored by Tore Halvorsen's avatar Tore Halvorsen Committed by Martin Sustrik

Accessing an iterator after it is accessed is not valid.

Moving the erase after the access and check agains current_id.
parent ceb5e1a0
......@@ -100,9 +100,9 @@ void zmq::xrep_t::terminated (reader_t *pipe_)
for (inpipes_t::iterator it = inpipes.begin (); it != inpipes.end ();
++it) {
if (it->reader == pipe_) {
inpipes.erase (it);
if ((inpipes_t::size_type) (it - inpipes.begin ()) < current_in)
current_in--;
inpipes.erase (it);
if (terminating)
unregister_term_ack ();
return;
......
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