diff --git a/lib/include/srslte/common/timers.h b/lib/include/srslte/common/timers.h index d77692d5a..7517aa751 100644 --- a/lib/include/srslte/common/timers.h +++ b/lib/include/srslte/common/timers.h @@ -151,15 +151,15 @@ public: fprintf(stderr, "Error getting unique timer id: no more timers available\n"); return 0; } else { - while(used_timers[next_timer]) { - next_timer++; - if (next_timer >= nof_timers) { - next_timer=0; + for (uint32_t i=0;itimer_get(active[measId].periodic_timer)->stop(); mac_timers->timer_release_id(active[measId].periodic_timer); - log_h->info("MEAS: Removed measId=%d\n", measId); + log_h->info("MEAS: Removed measId=%d, timer_id=%d\n", measId, active[measId].periodic_timer); active.erase(measId); } else { log_h->warning("MEAS: Removing unexistent measId=%d\n", measId); @@ -2846,7 +2846,7 @@ void rrc::rrc_meas::remove_meas_id(uint32_t measId) { void rrc::rrc_meas::remove_meas_id(std::map::iterator it) { mac_timers->timer_get(it->second.periodic_timer)->stop(); mac_timers->timer_release_id(it->second.periodic_timer); - log_h->info("MEAS: Removed measId=%d\n", it->first); + log_h->info("MEAS: Removed measId=%d, timer_id=%d\n", it->first, active[measId].periodic_timer); active.erase(it); }