fix memory leaks RLC AM test

This commit is contained in:
Andre Puschmann 2018-02-16 12:41:13 +01:00
parent 75f42ac829
commit b5b1c0bf4b
1 changed files with 18 additions and 0 deletions

View File

@ -59,6 +59,14 @@ public:
n_sdus = 0; n_sdus = 0;
} }
~rlc_am_tester(){
for (uint32_t i = 0; i < 10; i++) {
if (sdus[i] != NULL) {
byte_buffer_pool::get_instance()->deallocate(sdus[i]);
}
}
}
// PDCP interface // PDCP interface
void write_pdu(uint32_t lcid, byte_buffer_t *sdu) void write_pdu(uint32_t lcid, byte_buffer_t *sdu)
{ {
@ -1051,21 +1059,31 @@ void resegment_test_6()
int main(int argc, char **argv) { int main(int argc, char **argv) {
basic_test(); basic_test();
byte_buffer_pool::get_instance()->cleanup(); byte_buffer_pool::get_instance()->cleanup();
concat_test(); concat_test();
byte_buffer_pool::get_instance()->cleanup(); byte_buffer_pool::get_instance()->cleanup();
segment_test(); segment_test();
byte_buffer_pool::get_instance()->cleanup(); byte_buffer_pool::get_instance()->cleanup();
retx_test(); retx_test();
byte_buffer_pool::get_instance()->cleanup(); byte_buffer_pool::get_instance()->cleanup();
resegment_test_1(); resegment_test_1();
byte_buffer_pool::get_instance()->cleanup(); byte_buffer_pool::get_instance()->cleanup();
resegment_test_2(); resegment_test_2();
byte_buffer_pool::get_instance()->cleanup(); byte_buffer_pool::get_instance()->cleanup();
resegment_test_3(); resegment_test_3();
byte_buffer_pool::get_instance()->cleanup(); byte_buffer_pool::get_instance()->cleanup();
resegment_test_4(); resegment_test_4();
byte_buffer_pool::get_instance()->cleanup(); byte_buffer_pool::get_instance()->cleanup();
resegment_test_5(); resegment_test_5();
byte_buffer_pool::get_instance()->cleanup(); byte_buffer_pool::get_instance()->cleanup();
resegment_test_6(); resegment_test_6();
byte_buffer_pool::get_instance()->cleanup();
} }