From e27fa138376a76b0138f841ecbba0a1fb61c3164 Mon Sep 17 00:00:00 2001 From: "Robert M. Thomson" Date: Tue, 6 Oct 2026 20:22:28 +0200 Subject: [PATCH] fix: release temporary factory host application references in VST3 Fixes #547 --- distrho/src/DistrhoPluginVST3.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/distrho/src/DistrhoPluginVST3.cpp b/distrho/src/DistrhoPluginVST3.cpp index 17b81b8f8..6a584c8f2 100644 --- a/distrho/src/DistrhoPluginVST3.cpp +++ b/distrho/src/DistrhoPluginVST3.cpp @@ -4800,6 +4800,8 @@ struct dpf_factory : v3_plugin_factory_cpp { { dpf_component** const componentptr = new dpf_component*; *componentptr = new dpf_component(hostApplication); + if (hostApplication != nullptr) + v3_cpp_obj_unref(hostApplication); *instance = static_cast(componentptr); return V3_OK; } @@ -4811,6 +4813,8 @@ struct dpf_factory : v3_plugin_factory_cpp { { dpf_edit_controller** const controllerptr = new dpf_edit_controller*; *controllerptr = new dpf_edit_controller(hostApplication); + if (hostApplication != nullptr) + v3_cpp_obj_unref(hostApplication); *instance = static_cast(controllerptr); return V3_OK; }