1: // Created by Frank M. Carrano and Tim Henry.
2: // Copyright (c) 2013 __Pearson Education__. All rights reserved.
4: /** @file GoodMemory.cpp
5: Listing C2-3 */
6: #include "GoodMemory.h"
8: GoodMemory::GoodMemory() : someBoxPtr(nullptr)
9: {
10: } // end default constructor
12: GoodMemory::~GoodMemory()
13: {
14: delete someBoxPtr;
15: } // end destructor
17: void GoodMemory::fixedLeak(const double& someItem)
18: {
19: someBoxPtr = new ToyBox<double>();
20: someBoxPtr->setItem(someItem);
21: } // end fixedLeak