Skip to content

Commit

Permalink
Permit a special case in which libraries are not unloaded
Browse files Browse the repository at this point in the history
  • Loading branch information
cannam committed Sep 27, 2024
1 parent d7ceb7d commit 703438d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/vamp-hostsdk/Files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,18 @@ Files::loadLibrary(string path)
void
Files::unloadLibrary(void *handle)
{
// For special purposes allow the build to specify that libraries
// should not be unloaded. This turns out to be useful with some
// older plugins we have tried on 32-bit Windows which crash if
// unloaded and reloaded again in the same process.
#ifndef DO_NOT_FREE_LIBRARIES

#ifdef _WIN32
FreeLibrary((HINSTANCE)handle);
#else
dlclose(handle);
#endif
#endif
}

void *
Expand Down

0 comments on commit 703438d

Please sign in to comment.