diff options
-rw-r--r-- | CommonLibs/LinkedLists.cpp | 19 | ||||
-rw-r--r-- | CommonLibs/LinkedLists.h | 1 |
2 files changed, 20 insertions, 0 deletions
diff --git a/CommonLibs/LinkedLists.cpp b/CommonLibs/LinkedLists.cpp index 35a8541..b73a579 100644 --- a/CommonLibs/LinkedLists.cpp +++ b/CommonLibs/LinkedLists.cpp @@ -29,6 +29,25 @@ #include "LinkedLists.h" +PointerFIFO::~PointerFIFO() +{ + ListNode *node, *next; + + node = mHead; + while (node != NULL) { + next = node->next(); + delete node; + node = next; + } + + node = mFreeList; + while (node != NULL) { + next = node->next(); + delete node; + node = next; + } +} + void PointerFIFO::push_front(void* val) // by pat { // Pat added this routine for completeness, but never used or tested. diff --git a/CommonLibs/LinkedLists.h b/CommonLibs/LinkedLists.h index 31fb9c5..136d13d 100644 --- a/CommonLibs/LinkedLists.h +++ b/CommonLibs/LinkedLists.h @@ -70,6 +70,7 @@ class PointerFIFO { :mHead(NULL),mTail(NULL),mFreeList(NULL), mSize(0) {} + ~PointerFIFO(); unsigned size() const { return mSize; } unsigned totalSize() const { return 0; } // Not used in this version. |