mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-28 16:15:23 +08:00
Merge pull request #1771 from bluca/valgrind_iterator
Problem: Valgrind reports read of freed memory
This commit is contained in:
commit
02120203b2
@ -99,9 +99,11 @@ void zmq::radio_t::xwrite_activated (pipe_t *pipe_)
|
||||
|
||||
void zmq::radio_t::xpipe_terminated (pipe_t *pipe_)
|
||||
{
|
||||
for (subscriptions_t::iterator it = subscriptions.begin (); it != subscriptions.end (); ++it) {
|
||||
for (subscriptions_t::iterator it = subscriptions.begin (); it != subscriptions.end (); ) {
|
||||
if (it->second == pipe_) {
|
||||
subscriptions.erase (it);
|
||||
subscriptions.erase (it++);
|
||||
} else {
|
||||
++it;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user