From 10120214ac0d3ec4af146fcb95e3a114ed6f8da5 Mon Sep 17 00:00:00 2001 From: Tore Halvorsen Date: Wed, 4 May 2011 12:41:10 +0200 Subject: Accessing an iterator after it is accessed is not valid. Moving the erase after the access and check agains current_id. --- src/xrep.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/xrep.cpp') 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; -- cgit v1.2.3