summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTore Halvorsen <tore.halvorsen@gmail.com>2011-05-04 12:41:10 +0200
committerMartin Sustrik <sustrik@250bpm.com>2011-05-04 12:41:10 +0200
commit10120214ac0d3ec4af146fcb95e3a114ed6f8da5 (patch)
tree3a974f8b8e6491da97b94bc2fb3ad134777cf849 /src
parentceb5e1a0734b0c73bd7f74ec5094ae6ad4f9dfc4 (diff)
Accessing an iterator after it is accessed is not valid.
Moving the erase after the access and check agains current_id.
Diffstat (limited to 'src')
-rw-r--r--src/xrep.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/xrep.cpp b/src/xrep.cpp
index 2466f57..15fac8d 100644
--- a/src/xrep.cpp
+++ b/src/xrep.cpp
@@ -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;