summaryrefslogtreecommitdiffstats
path: root/Source/cmDynamicLoader.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmDynamicLoader.cxx')
-rw-r--r--Source/cmDynamicLoader.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/Source/cmDynamicLoader.cxx b/Source/cmDynamicLoader.cxx
index 7e21a7f..75c3850 100644
--- a/Source/cmDynamicLoader.cxx
+++ b/Source/cmDynamicLoader.cxx
@@ -44,7 +44,6 @@ cmDynamicLoaderCache* cmDynamicLoaderCache::Instance = 0;
cmDynamicLoaderCache::~cmDynamicLoaderCache()
{
- this->FlushCache();
}
void cmDynamicLoaderCache::CacheFile(const char* path, const cmLibHandle& p)
@@ -71,13 +70,16 @@ bool cmDynamicLoaderCache::GetCacheFile(const char* path, cmLibHandle& p)
bool cmDynamicLoaderCache::FlushCache(const char* path)
{
std::map<std::string, cmLibHandle>::iterator it = m_CacheMap.find(path);
+ bool ret = false;
if ( it != m_CacheMap.end() )
{
cmDynamicLoader::CloseLibrary(it->second);
m_CacheMap.erase(it);
- return true;
+ ret = true;
}
- return false;
+ delete cmDynamicLoaderCache::Instance;
+ cmDynamicLoaderCache::Instance = 0;
+ return ret;
}
void cmDynamicLoaderCache::FlushCache()