mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-02 20:30:14 +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 ();
|
||||
++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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user