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
This commit is contained in:
parent
f45ede640b
commit
62e06f92e9
|
@ -293,7 +293,6 @@ void tbf_free(struct gprs_rlcmac_tbf *tbf)
|
|||
gprs_rlcmac_dl_tbf *dl_tbf = as_dl_tbf(tbf);
|
||||
|
||||
dl_tbf->abort();
|
||||
dl_tbf->cleanup();
|
||||
}
|
||||
|
||||
LOGPTBF(tbf, LOGL_INFO, "free\n");
|
||||
|
|
|
@ -177,6 +177,12 @@ struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, GprsMs
|
|||
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 @@ gprs_rlcmac_dl_tbf::gprs_rlcmac_dl_tbf(struct gprs_rlcmac_bts *bts_, GprsMs *ms)
|
|||
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) {
|
||||
|
|
|
@ -42,8 +42,8 @@ enum tbf_dl_prio {
|
|||
|
||||
struct gprs_rlcmac_dl_tbf : public gprs_rlcmac_tbf {
|
||||
gprs_rlcmac_dl_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms);
|
||||
~gprs_rlcmac_dl_tbf();
|
||||
gprs_rlc_window *window();
|
||||
void cleanup();
|
||||
|
||||
int append_data(uint16_t pdu_delay_csec,
|
||||
const uint8_t *data, uint16_t len);
|
||||
|
|
Loading…
Reference in New Issue