Fixes to mac dynamic lib loading.

Fix to prevent crash on uninstall of plugins loaded from disk.
This commit is contained in:
Joshua Jones 2010-02-24 05:02:37 +00:00
parent 73db60b26e
commit 7e47541272
2 changed files with 2 additions and 3 deletions

View File

@ -15,7 +15,6 @@
#endif
#ifdef CAUDIO_PLATFORM_MAC
# include "macUtils.h"
# include <dlfcn.h>
#endif
@ -42,7 +41,7 @@ typedef struct HINSTANCE__* hInstance;
#ifdef CAUDIO_PLATFORM_MAC
# define DYNLIB_HANDLE void*
# define DYNLIB_LOAD( a ) mac_loadDylib( a )
# define DYNLIB_LOAD( a ) dlopen( a, RTLD_LAZY | RTLD_GLOBAL)
# define DYNLIB_GETSYM( a, b ) dlsym( a, b )
# define DYNLIB_UNLOAD( a ) dlclose( a )
#endif

View File

@ -115,12 +115,12 @@ void cPluginManager::uninstallPlugin(IAudioPlugin* plugin)
if(it2 != DynamicallyLoadedPlugins.end())
{
//Found a plugin we loaded from the filesystem, unload it and delete the plugin
it2->first->drop();
if(DYNLIB_UNLOAD(it2->second))
{
//Could be an error, not reporting it for now
}
DynamicallyLoadedPlugins.erase(it2->first);
delete plugin;
}
}
}