summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/cmDynamicLoader.cxx5
-rw-r--r--Source/cmaketest.cxx14
2 files changed, 15 insertions, 4 deletions
diff --git a/Source/cmDynamicLoader.cxx b/Source/cmDynamicLoader.cxx
index 75c3850..680e50c 100644
--- a/Source/cmDynamicLoader.cxx
+++ b/Source/cmDynamicLoader.cxx
@@ -77,8 +77,6 @@ bool cmDynamicLoaderCache::FlushCache(const char* path)
m_CacheMap.erase(it);
ret = true;
}
- delete cmDynamicLoaderCache::Instance;
- cmDynamicLoaderCache::Instance = 0;
return ret;
}
@@ -89,7 +87,8 @@ void cmDynamicLoaderCache::FlushCache()
{
cmDynamicLoader::CloseLibrary(it->second);
}
- m_CacheMap.erase(m_CacheMap.begin(), m_CacheMap.end());
+ delete cmDynamicLoaderCache::Instance;
+ cmDynamicLoaderCache::Instance = 0;
}
cmDynamicLoaderCache* cmDynamicLoaderCache::GetInstance()
diff --git a/Source/cmaketest.cxx b/Source/cmaketest.cxx
index 45ce992..e21ef6f 100644
--- a/Source/cmaketest.cxx
+++ b/Source/cmaketest.cxx
@@ -20,13 +20,25 @@
#include "cmake.h"
#include "cmListFileCache.h"
#include "cmCacheManager.h"
+#include "cmDynamicLoader.h"
#if defined(_WIN32) && !defined(__CYGWIN__)
#include "windows.h"
#endif
+int do_cmaketest(int ac, char** av);
+
+int main(int ac, char** av)
+{
+ int ret = do_cmaketest(ac, av);
+#ifdef CMAKE_BUILD_WITH_CMAKE
+ cmDynamicLoader::FlushCache();
+#endif
+ cmListFileCache::GetInstance()->ClearCache();
+ return ret;
+}
// this is a test driver program for cmake.
-int main (int argc, char **argv)
+int do_cmaketest (int argc, char **argv)
{
if (argc < 4)
{