Skip to content

Commit 7e684cd

Browse files
author
Mirela Chirica
committed
Cellular: Destructor added for CellularList
1 parent 658358c commit 7e684cd

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

features/cellular/framework/common/CellularList.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,17 @@ template <class T> class CellularList
3838
_tail=NULL;
3939
}
4040

41+
~CellularList()
42+
{
43+
T *temp = _head;
44+
while (temp) {
45+
_head = _head->next;
46+
delete temp;
47+
temp = _head;
48+
}
49+
_tail=NULL;
50+
}
51+
4152
T* add_new()
4253
{
4354
T *temp=new T;
@@ -88,6 +99,7 @@ template <class T> class CellularList
8899
delete temp;
89100
temp = _head;
90101
}
102+
_tail=NULL;
91103
}
92104

93105

0 commit comments

Comments
 (0)