Browse Source

Fixed nasty library load/unload bug

master
waxfrenzy 22 years ago
parent
commit
09ec7c8a8e
1 changed files with 3 additions and 13 deletions
  1. +3
    -13
      SpiralSound/Plugins/LADSPAPlugin/LADSPAInfo.C

+ 3
- 13
SpiralSound/Plugins/LADSPAPlugin/LADSPAInfo.C View File

@@ -208,20 +208,10 @@ LADSPAInfo::DiscardDescriptorByID(unsigned long unique_id)
if (li->RefCount > 0) { if (li->RefCount > 0) {
li->RefCount--; li->RefCount--;
if (li->RefCount == 0) { if (li->RefCount == 0) {
// Unload and clear library handle
dlclose(li->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;
} }
} }
} }


Loading…
Cancel
Save