diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2001-06-04 14:18:03 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2001-06-04 14:18:03 (GMT) |
commit | a3cfcd9894a5d626b8beba80fc8b5934ea3f46cf (patch) | |
tree | 73155ed903d3138946d64f4da4631954c8601b4e /Source/cmCacheManager.cxx | |
parent | abab6bc00069df6ff1988abced39b98ea199febc (diff) | |
download | CMake-a3cfcd9894a5d626b8beba80fc8b5934ea3f46cf.zip CMake-a3cfcd9894a5d626b8beba80fc8b5934ea3f46cf.tar.gz CMake-a3cfcd9894a5d626b8beba80fc8b5934ea3f46cf.tar.bz2 |
BUG: clean up memory leaks.
Diffstat (limited to 'Source/cmCacheManager.cxx')
-rw-r--r-- | Source/cmCacheManager.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index d183e23..b28ec3e 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -70,12 +70,24 @@ cmCacheManager::CacheEntryType cmCacheManager::StringToType(const char* s) } +struct CleanUpCacheManager +{ + ~CleanUpCacheManager() + { + delete cmCacheManager::GetInstance(); + } + void Use() {} +}; + +CleanUpCacheManager cleanup; + cmCacheManager* cmCacheManager::s_Instance = 0; cmCacheManager* cmCacheManager::GetInstance() { if(!cmCacheManager::s_Instance) { + cleanup.Use(); cmCacheManager::s_Instance = new cmCacheManager; } return cmCacheManager::s_Instance; |