Skip to content
Snippets Groups Projects
Commit aef68e64 authored by Mathieu Malaterre's avatar Mathieu Malaterre
Browse files

ENH: Fix dashboard with coverage

parent c66d02f2
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment