From 09ec7c8a8e8484eea8482a6ed44024d34dda14e5 Mon Sep 17 00:00:00 2001 From: waxfrenzy Date: Wed, 29 Jan 2003 19:52:28 +0000 Subject: [PATCH] Fixed nasty library load/unload bug --- SpiralSound/Plugins/LADSPAPlugin/LADSPAInfo.C | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/SpiralSound/Plugins/LADSPAPlugin/LADSPAInfo.C b/SpiralSound/Plugins/LADSPAPlugin/LADSPAInfo.C index 4c15473..f809509 100644 --- a/SpiralSound/Plugins/LADSPAPlugin/LADSPAInfo.C +++ b/SpiralSound/Plugins/LADSPAPlugin/LADSPAInfo.C @@ -208,20 +208,10 @@ LADSPAInfo::DiscardDescriptorByID(unsigned long unique_id) if (li->RefCount > 0) { li->RefCount--; if (li->RefCount == 0) { + + // Unload and clear library handle dlclose(li->Handle); - - // Need to unset all plugin descriptors that may have been - // set from this library - // Plugins in library will be a contiguous block, so we - // just check each direction from given plugin - unsigned long i = plugin_index - 1; - while (m_Plugins[i].LibraryIndex == pi->LibraryIndex) { - m_Plugins[i--].Descriptor = NULL; - } - i = plugin_index + 1; - while (m_Plugins[i].LibraryIndex == pi->LibraryIndex) { - m_Plugins[i++].Descriptor = NULL; - } + li->Handle = NULL; } } }