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; }