summaryrefslogtreecommitdiffstats
path: root/Source/kwsys
diff options
context:
space:
mode:
authorMathieu Malaterre <mathieu.malaterre@gmail.com>2006-03-13 16:27:12 (GMT)
committerMathieu Malaterre <mathieu.malaterre@gmail.com>2006-03-13 16:27:12 (GMT)
commit7f5222d400ab7f2d95099933abeee769bc23b38c (patch)
tree2c41a9de67e60038485d16c74a39004c023fd9a7 /Source/kwsys
parent7b36bf6cfd54352d43b12fde98eeba003c170a79 (diff)
downloadCMake-7f5222d400ab7f2d95099933abeee769bc23b38c.zip
CMake-7f5222d400ab7f2d95099933abeee769bc23b38c.tar.gz
CMake-7f5222d400ab7f2d95099933abeee769bc23b38c.tar.bz2
ENH: Fix dashboard with coverage
Diffstat (limited to 'Source/kwsys')
-rw-r--r--Source/kwsys/DynamicLoader.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/kwsys/DynamicLoader.cxx b/Source/kwsys/DynamicLoader.cxx
index 887f5ab..7755296 100644
--- a/Source/kwsys/DynamicLoader.cxx
+++ b/Source/kwsys/DynamicLoader.cxx
@@ -167,7 +167,13 @@ LibHandle DynamicLoader::OpenLibrary(const char* libname )
//----------------------------------------------------------------------------
int DynamicLoader::CloseLibrary( LibHandle lib)
{
- bool success = NSUnLinkModule(lib, NSUNLINKMODULE_OPTION_NONE);
+ // Initially this function was written using NSUNLINKMODULE_OPTION_NONE, but when
+ // the code is compiled with coverage on, one cannot close the library properly
+ // so instead of not unloading the library. We use a special option:
+ // NSUNLINKMODULE_OPTION_KEEP_MEMORY_MAPPED
+ // With this option the memory for the module is not deallocated
+ // allowing pointers into the module to still be valid.
+ bool success = NSUnLinkModule(lib, NSUNLINKMODULE_OPTION_KEEP_MEMORY_MAPPED);
return success;
}