diff --git a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp index 3b3851ac61..a2a35b2e8a 100644 --- a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp +++ b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp @@ -1139,11 +1139,11 @@ struct DLLHandle #else if (bundleRef != nullptr) { + releaseFactory(); + if (ExitModuleFn exitFn = (ExitModuleFn) getFunction ("bundleExit")) exitFn(); - releaseFactory(); - CFRelease (bundleRef); bundleRef = nullptr; }