mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-03 12:58:05 +01:00
Accessing an iterator after it is accessed is not valid.
Moving the erase after the access and check agains current_id.
This commit is contained in:
parent
ceb5e1a073
commit
10120214ac
@ -100,9 +100,9 @@ void zmq::xrep_t::terminated (reader_t *pipe_)
|
|||||||
for (inpipes_t::iterator it = inpipes.begin (); it != inpipes.end ();
|
for (inpipes_t::iterator it = inpipes.begin (); it != inpipes.end ();
|
||||||
++it) {
|
++it) {
|
||||||
if (it->reader == pipe_) {
|
if (it->reader == pipe_) {
|
||||||
inpipes.erase (it);
|
|
||||||
if ((inpipes_t::size_type) (it - inpipes.begin ()) < current_in)
|
if ((inpipes_t::size_type) (it - inpipes.begin ()) < current_in)
|
||||||
current_in--;
|
current_in--;
|
||||||
|
inpipes.erase (it);
|
||||||
if (terminating)
|
if (terminating)
|
||||||
unregister_term_ack ();
|
unregister_term_ack ();
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user