Commit 8fa3865f authored by Zhang Jingwang's avatar Zhang Jingwang Committed by Dries Kimpe
Browse files

Advance the iterator before it is erased

Otherwise, the iterator might be invalidated by erase().
parent 90088319
......@@ -340,6 +340,7 @@ namespace iofwdevent
if (delivered)
{
UEClientListType::iterator removeclient = I;
I++; // erase() might invalidate the iterator.
ue_clientlist_.erase (removeclient);
*c.outcount = delivered;
......@@ -366,10 +367,11 @@ namespace iofwdevent
ue_lock_.lock ();
// We need the lock to protect access to the mem pool
ue_client_pool_.free (&c);
}
} else {
// Try next client
++I;
// Try next client
++I;
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment