diff --git a/lib/src/upper/rlc.cc b/lib/src/upper/rlc.cc index 389130857..16559bf5c 100644 --- a/lib/src/upper/rlc.cc +++ b/lib/src/upper/rlc.cc @@ -27,9 +27,11 @@ rlc::rlc(const char* logname) : logger(srslog::fetch_basic_logger(logname)), poo rlc::~rlc() { // destroy all remaining entities - srsran::rwlock_write_guard lock(rwlock); - rlc_array.clear(); - rlc_array_mrb.clear(); + { + srsran::rwlock_write_guard lock(rwlock); + rlc_array.clear(); + rlc_array_mrb.clear(); + } pthread_rwlock_destroy(&rwlock); }