diff --git a/src/app/Queue.h b/src/app/Queue.h index b43d7c8..0c12bef 100644 --- a/src/app/Queue.h +++ b/src/app/Queue.h @@ -43,9 +43,11 @@ public: if(isQueueEmpty(_head->_next))return NULL; T *refToReturn = _head->_next->_value; - + Queue *toDelete(_head->_next); _head->_next = _head->_next->_next; - + + delete toDelete; + return refToReturn; } T remove() @@ -74,6 +76,7 @@ public: toDelete = cursor; cursor = cursor->_next; + delete toDelete->_value; delete toDelete; } _head = this;