Cellular: Destructor added for CellularList

pull/6691/head
Mirela Chirica 2018-04-16 13:37:50 +03:00
parent 658358cbf1
commit 7e684cd789
1 changed files with 12 additions and 0 deletions

View File

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