From 75f42ac82955fa55d4925f3805495d676f6d34e5 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Fri, 16 Feb 2018 12:40:07 +0100 Subject: [PATCH] add RLC AM destructor --- lib/include/srslte/upper/rlc_am.h | 1 + lib/src/upper/rlc_am.cc | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/lib/include/srslte/upper/rlc_am.h b/lib/include/srslte/upper/rlc_am.h index 2311b23cb..7601baefa 100644 --- a/lib/include/srslte/upper/rlc_am.h +++ b/lib/include/srslte/upper/rlc_am.h @@ -71,6 +71,7 @@ class rlc_am { public: rlc_am(); + ~rlc_am(); void init(log *rlc_entity_log_, uint32_t lcid_, srsue::pdcp_interface_rlc *pdcp_, diff --git a/lib/src/upper/rlc_am.cc b/lib/src/upper/rlc_am.cc index 413a02ac1..652970011 100644 --- a/lib/src/upper/rlc_am.cc +++ b/lib/src/upper/rlc_am.cc @@ -68,6 +68,20 @@ rlc_am::rlc_am() : tx_sdu_queue(16) do_status = false; } +rlc_am::~rlc_am() +{ + // reset RLC and dealloc SDUs + stop(); + + if(rx_sdu) { + pool->deallocate(rx_sdu); + } + + if(tx_sdu) { + pool->deallocate(tx_sdu); + } +} + void rlc_am::init(srslte::log *log_, uint32_t lcid_, srsue::pdcp_interface_rlc *pdcp_,