diff options
Diffstat (limited to '')
-rw-r--r-- | default.bld | 4 | ||||
-rw-r--r-- | src/unstable/cachebase.h | 11 |
2 files changed, 13 insertions, 2 deletions
diff --git a/default.bld b/default.bld index 2077185..8f21f6c 100644 --- a/default.bld +++ b/default.bld | |||
@@ -16,8 +16,8 @@ include "gensigs.bld"; | |||
16 | CXXFLAGS += "-ggdb -W -Wall -I."; | 16 | CXXFLAGS += "-ggdb -W -Wall -I."; |
17 | 17 | ||
18 | // Deep memory checks | 18 | // Deep memory checks |
19 | CXXFLAGS += "-fsanitize=address -fno-omit-frame-pointer"; | 19 | // CXXFLAGS += "-fsanitize=address -fno-omit-frame-pointer"; |
20 | LDFLAGS += "-fsanitize=address -fno-omit-frame-pointer"; | 20 | // LDFLAGS += "-fsanitize=address -fno-omit-frame-pointer"; |
21 | 21 | ||
22 | //CXXFLAGS += "-pg"; | 22 | //CXXFLAGS += "-pg"; |
23 | //LDFLAGS += "-pg"; | 23 | //LDFLAGS += "-pg"; |
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; |