From 18cd5f331b8d043a7f9c4d161f2319dc456dfcc9 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 11 Jul 2023 14:06:33 -0700 Subject: Fixed cachebase memory leak. --- src/unstable/cachebase.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/unstable') diff --git a/src/unstable/cachebase.h b/src/unstable/cachebase.h index 7a54465..762aca2 100644 --- a/src/unstable/cachebase.h +++ b/src/unstable/cachebase.h @@ -34,6 +34,13 @@ namespace Bu { } + virtual ~CacheEntry() + { + mEntry.lock(); + delete pObject; + mEntry.unlock(); + } + public: int getRefCount() const { @@ -386,6 +393,10 @@ namespace Bu virtual ~CacheBase() { + for( typename CacheEntryHash::iterator i = hCacheEntry.begin(); i; i++ ) + { + delete i.getValue(); + } } typedef CacheEntry Entry; -- cgit v1.2.3