Destructor
| 119 | |
| 120 | /// Destructor |
| 121 | ~Stack() { |
| 122 | |
| 123 | clear(); |
| 124 | |
| 125 | if (mCapacity > 0) { |
| 126 | |
| 127 | // Release the memory allocated on the heap |
| 128 | mAllocator.release(mArray, mCapacity * sizeof(T)); |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | /// Remove all the items from the stack |
| 133 | void clear() { |