diff --git a/lib/src/upper/pdcp.cc b/lib/src/upper/pdcp.cc index 93ac0cf15..0fce441ad 100644 --- a/lib/src/upper/pdcp.cc +++ b/lib/src/upper/pdcp.cc @@ -93,10 +93,10 @@ void pdcp::reset() { // destroy all bearers pthread_rwlock_wrlock(&rwlock); - for (pdcp_map_t::iterator it = pdcp_array.begin(); it != pdcp_array.end(); ++it) { + for (pdcp_map_t::iterator it = pdcp_array.begin(); it != pdcp_array.end(); /* post increment in erase */ ) { it->second->reset(); delete(it->second); - pdcp_array.erase(it); + pdcp_array.erase(it++); } pthread_rwlock_unlock(&rwlock);