diff --git a/allocPool.hpp b/allocPool.hpp index 5f1a090..f57d437 100644 --- a/allocPool.hpp +++ b/allocPool.hpp @@ -24,6 +24,11 @@ public: initArray(defaultAllocNumbers); } + ~allocPool() { + for (auto i: vec) + delete i; + } + T *getPtr() { if (pivot == 0) resizeVec(); diff --git a/main.cpp b/main.cpp index 1d8375e..712f14f 100644 --- a/main.cpp +++ b/main.cpp @@ -34,6 +34,5 @@ int main() { std::cout << "Time (milliseconds) required for real allocations when constructing pool: " << std::chrono::duration_cast(endAlloc - startAlloc).count() << "\n"; - return 0; }