Missed delete in ex7.4 Stack
This commit is contained in:
parent
d9d2d5f18f
commit
e363d023cd
1 changed files with 3 additions and 0 deletions
|
@ -11,6 +11,9 @@ class Stack {
|
||||||
Stack() {
|
Stack() {
|
||||||
_s = new std::deque<T>();
|
_s = new std::deque<T>();
|
||||||
}
|
}
|
||||||
|
~Stack() {
|
||||||
|
delete _s;
|
||||||
|
}
|
||||||
|
|
||||||
int nitems() { return _s->size() ; }
|
int nitems() { return _s->size() ; }
|
||||||
bool empty() { return (_s->size() == 0) ; }
|
bool empty() { return (_s->size() == 0) ; }
|
||||||
|
|
Reference in a new issue