Fixes to mac dynamic lib loading.
Fix to prevent crash on uninstall of plugins loaded from disk.
This commit is contained in:
parent
73db60b26e
commit
7e47541272
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue