From 7e684cd789fc1933994f0e0a1ae1214edba55c34 Mon Sep 17 00:00:00 2001 From: Mirela Chirica Date: Mon, 16 Apr 2018 13:37:50 +0300 Subject: [PATCH] Cellular: Destructor added for CellularList --- features/cellular/framework/common/CellularList.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/features/cellular/framework/common/CellularList.h b/features/cellular/framework/common/CellularList.h index 50f9ab7fc4..387a07f984 100644 --- a/features/cellular/framework/common/CellularList.h +++ b/features/cellular/framework/common/CellularList.h @@ -38,6 +38,17 @@ public: _tail=NULL; } + ~CellularList() + { + T *temp = _head; + while (temp) { + _head = _head->next; + delete temp; + temp = _head; + } + _tail=NULL; + } + T* add_new() { T *temp=new T; @@ -88,6 +99,7 @@ public: delete temp; temp = _head; } + _tail=NULL; }