diff --git a/lib/src/upper/pdcp.cc b/lib/src/upper/pdcp.cc index 24dbd27d3..acf0d6988 100644 --- a/lib/src/upper/pdcp.cc +++ b/lib/src/upper/pdcp.cc @@ -91,14 +91,16 @@ void pdcp::reestablish() { void pdcp::reset() { - pthread_rwlock_rdlock(&rwlock); + // destroy all bearers + pthread_rwlock_wrlock(&rwlock); for (pdcp_map_t::iterator it = pdcp_array.begin(); it != pdcp_array.end(); ++it) { - it->second->reset(); - } - if (valid_lcid(0)) { - pdcp_array.at(0)->init(rlc, rrc, gw, pdcp_log, default_lcid, default_cnfg); + delete(it->second); + pdcp_array.erase(it); } pthread_rwlock_unlock(&rwlock); + + // add default SRB0 again + add_bearer(0, default_cnfg); } /*******************************************************************************