From 23f308666976d347b9792cd77b30b0bd486b2778 Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Mon, 5 Mar 2018 15:13:24 +0100 Subject: [PATCH] Deallocate properly on dl_harq --- srsue/hdr/mac/dl_harq.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/srsue/hdr/mac/dl_harq.h b/srsue/hdr/mac/dl_harq.h index 982a6eac6..562008d61 100644 --- a/srsue/hdr/mac/dl_harq.h +++ b/srsue/hdr/mac/dl_harq.h @@ -227,6 +227,7 @@ private: ack = false; if (payload_buffer_ptr) { harq_entity->demux_unit->deallocate(payload_buffer_ptr); + payload_buffer_ptr = NULL; } bzero(&cur_grant, sizeof(Tgrant)); if (is_initiated) { @@ -314,6 +315,7 @@ private: } void tb_decoded(bool ack_) { + pthread_mutex_lock(&mutex); ack = ack_; if (ack) { if (pid == HARQ_BCCH_PID) { @@ -344,11 +346,15 @@ private: harq_entity->demux_unit->deallocate(payload_buffer_ptr); } + payload_buffer_ptr = NULL; + Info("DL %d (TB %d): %s tbs=%d, rv=%d, ack=%s, ndi=%d (%d), tti=%d (%d)\n", pid, tid, is_new_transmission ? "newTX" : "reTX ", cur_grant.n_bytes[tid], cur_grant.rv[tid], ack ? "OK" : "KO", cur_grant.ndi[tid], cur_grant.last_ndi[tid], cur_grant.tti, cur_grant.last_tti); + pthread_mutex_unlock(&mutex); + if (ack && pid == HARQ_BCCH_PID) { reset(); }