summaryrefslogtreecommitdiffstats
path: root/Source/cmCacheManager.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2002-08-23 17:46:32 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2002-08-23 17:46:32 (GMT)
commit3f36d234213fd9e23a9402eabb2198e79c6ebe61 (patch)
tree59a7ab0bfb1f057894061347ae3891d03bdcc0c7 /Source/cmCacheManager.cxx
parent40cf734152304bd00a1c0895f4e37f0ff87ca43d (diff)
downloadCMake-3f36d234213fd9e23a9402eabb2198e79c6ebe61.zip
CMake-3f36d234213fd9e23a9402eabb2198e79c6ebe61.tar.gz
CMake-3f36d234213fd9e23a9402eabb2198e79c6ebe61.tar.bz2
BUG: add explicit clean up of the cachemanager at exit of programs, so dll destruction is not a problem.
Diffstat (limited to 'Source/cmCacheManager.cxx')
-rw-r--r--Source/cmCacheManager.cxx15
1 files changed, 5 insertions, 10 deletions
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index 81b5337..f15b4db 100644
--- a/Source/cmCacheManager.cxx
+++ b/Source/cmCacheManager.cxx
@@ -50,17 +50,13 @@ cmCacheManager::CacheEntryType cmCacheManager::StringToType(const char* s)
return STRING;
}
-
-struct CleanUpCacheManager
+void cmCacheManager::DeleteInstance()
{
- ~CleanUpCacheManager()
- {
- delete cmCacheManager::GetInstance();
- }
- void Use() {}
-};
+ delete cmCacheManager::GetInstance();
+ cmCacheManager::s_Instance = 0;
+}
-CleanUpCacheManager cleanup;
+
cmCacheManager* cmCacheManager::s_Instance = 0;
@@ -68,7 +64,6 @@ cmCacheManager* cmCacheManager::GetInstance()
{
if(!cmCacheManager::s_Instance)
{
- cleanup.Use();
cmCacheManager::s_Instance = new cmCacheManager;
}
return cmCacheManager::s_Instance;