Put dl_tbf::cleanup into destructor
It's fine to always attemt dropping the timer since it's set up in the
constructor.
This also drps the double function call abort()+cleanup() which is
confusing.
Change-Id: Ia2aaa43bd8faacf09fe4b36b11b38022bea7a59c
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index f264cfc..2154ed6 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -177,6 +177,12 @@
return tbf;
}
+gprs_rlcmac_dl_tbf::~gprs_rlcmac_dl_tbf()
+{
+ osmo_timer_del(&m_llc_timer);
+ /* ~gprs_rlcmac_dl_tbf() is called automatically upon return */
+}
+
gprs_rlcmac_dl_tbf::gprs_rlcmac_dl_tbf(struct gprs_rlcmac_bts *bts_, GprsMs *ms) :
gprs_rlcmac_tbf(bts_, ms, GPRS_RLCMAC_DL_TBF),
m_tx_counter(0),
@@ -191,11 +197,6 @@
osmo_timer_setup(&m_llc_timer, llc_timer_cb, this);
}
-void gprs_rlcmac_dl_tbf::cleanup()
-{
- osmo_timer_del(&m_llc_timer);
-}
-
void gprs_rlcmac_dl_tbf::start_llc_timer()
{
if (the_pcu->vty.llc_idle_ack_csec > 0) {