diff -r e2fafd224f43 -r 6a0c350463d5 src/mem/cache/cache.hh --- a/src/mem/cache/cache.hh Thu May 30 12:54:18 2013 -0400 +++ b/src/mem/cache/cache.hh Thu May 30 10:51:04 2013 -0700 @@ -411,6 +411,9 @@ /** Instantiates a basic cache object. */ Cache(const Params *p, TagStore *tags); + /** Non-default destructor is needed to deallocate memory. */ + virtual ~Cache(); + void regStats(); /** serialize the state of the caches diff -r e2fafd224f43 -r 6a0c350463d5 src/mem/cache/cache_impl.hh --- a/src/mem/cache/cache_impl.hh Thu May 30 12:54:18 2013 -0400 +++ b/src/mem/cache/cache_impl.hh Thu May 30 10:51:04 2013 -0700 @@ -84,6 +84,16 @@ } template +Cache::~Cache() +{ + delete [] tempBlock->data; + delete tempBlock; + + delete cpuSidePort; + delete memSidePort; +} + +template void Cache::regStats() {