diff options
Diffstat (limited to 'src/unstable')
-rw-r--r-- | src/unstable/cachebase.h | 11 |
1 files changed, 11 insertions, 0 deletions
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 | |||
34 | { | 34 | { |
35 | } | 35 | } |
36 | 36 | ||
37 | virtual ~CacheEntry() | ||
38 | { | ||
39 | mEntry.lock(); | ||
40 | delete pObject; | ||
41 | mEntry.unlock(); | ||
42 | } | ||
43 | |||
37 | public: | 44 | public: |
38 | int getRefCount() const | 45 | int getRefCount() const |
39 | { | 46 | { |
@@ -386,6 +393,10 @@ namespace Bu | |||
386 | 393 | ||
387 | virtual ~CacheBase() | 394 | virtual ~CacheBase() |
388 | { | 395 | { |
396 | for( typename CacheEntryHash::iterator i = hCacheEntry.begin(); i; i++ ) | ||
397 | { | ||
398 | delete i.getValue(); | ||
399 | } | ||
389 | } | 400 | } |
390 | 401 | ||
391 | typedef CacheEntry<keytype, obtype> Entry; | 402 | typedef CacheEntry<keytype, obtype> Entry; |