add RLC UM destructor

master
Andre Puschmann 7 years ago
parent c5ffdfe8c7
commit 1be93d4682

@ -50,6 +50,7 @@ class rlc_um
{ {
public: public:
rlc_um(); rlc_um();
~rlc_um();
void init(log *rlc_entity_log_, void init(log *rlc_entity_log_,
uint32_t lcid_, uint32_t lcid_,

@ -59,6 +59,11 @@ rlc_um::rlc_um() : tx_sdu_queue(16)
pdu_lost = false; pdu_lost = false;
} }
rlc_um::~rlc_um()
{
stop();
}
void rlc_um::init(srslte::log *log_, void rlc_um::init(srslte::log *log_,
uint32_t lcid_, uint32_t lcid_,
srsue::pdcp_interface_rlc *pdcp_, srsue::pdcp_interface_rlc *pdcp_,
@ -114,12 +119,13 @@ void rlc_um::empty_queue() {
void rlc_um::stop() void rlc_um::stop()
{ {
reset(); reset();
if (mac_timers) {
mac_timers->timer_release_id(reordering_timer_id); mac_timers->timer_release_id(reordering_timer_id);
} }
}
void rlc_um::reset() void rlc_um::reset()
{ {
// Empty tx_sdu_queue before locking the mutex // Empty tx_sdu_queue before locking the mutex
empty_queue(); empty_queue();
@ -129,12 +135,17 @@ void rlc_um::reset()
vr_ux = 0; vr_ux = 0;
vr_uh = 0; vr_uh = 0;
pdu_lost = false; pdu_lost = false;
if(rx_sdu) if(rx_sdu) {
rx_sdu->reset(); pool->deallocate(rx_sdu);
if(tx_sdu) }
tx_sdu->reset();
if(mac_timers) if(tx_sdu) {
pool->deallocate(tx_sdu);
}
if(mac_timers) {
reordering_timer->stop(); reordering_timer->stop();
}
// Drop all messages in RX window // Drop all messages in RX window
std::map<uint32_t, rlc_umd_pdu_t>::iterator it; std::map<uint32_t, rlc_umd_pdu_t>::iterator it;

Loading…
Cancel
Save