ENH: Fix dashboard with coverage

This commit is contained in:
Mathieu Malaterre 2006-03-13 11:27:12 -05:00
parent 7b36bf6cfd
commit 7f5222d400
1 changed files with 7 additions and 1 deletions

View File

@ -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;
}