diff --git a/modules/juce_audio_processors/format_types/LV2_SDK/README.md b/modules/juce_audio_processors/format_types/LV2_SDK/README.md index e4b02ab560..7d6e748919 100644 --- a/modules/juce_audio_processors/format_types/LV2_SDK/README.md +++ b/modules/juce_audio_processors/format_types/LV2_SDK/README.md @@ -7,6 +7,8 @@ directory. The following modifications were made: - Removed the include of dlfcn.h in world.c - Fixed a leak of world->opt.lv2_path when calling lilv_world_set_option multiple times +- Fixed a leak of plugin classes when calling lilv_world_load_plugin_classes + multiple times Remember to update the versions in the config headers if you ever update the library versions! diff --git a/modules/juce_audio_processors/format_types/LV2_SDK/lilv/src/world.c b/modules/juce_audio_processors/format_types/LV2_SDK/lilv/src/world.c index 3a601ab85c..5f1818dc7a 100644 --- a/modules/juce_audio_processors/format_types/LV2_SDK/lilv/src/world.c +++ b/modules/juce_audio_processors/format_types/LV2_SDK/lilv/src/world.c @@ -1046,7 +1046,8 @@ lilv_world_load_plugin_classes(LilvWorld* world) LilvPluginClass* pclass = lilv_plugin_class_new( world, parent, class_node, (const char*)sord_node_get_string(label)); if (pclass) { - zix_tree_insert((ZixTree*)world->plugin_classes, pclass, NULL); + if (zix_tree_insert((ZixTree*)world->plugin_classes, pclass, NULL) == ZIX_STATUS_EXISTS) + lilv_plugin_class_free(pclass); } sord_node_free(world->world, label);