summaryrefslogtreecommitdiffstats
path: root/Source/cmCacheManager.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmCacheManager.cxx')
-rw-r--r--Source/cmCacheManager.cxx12
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;