diff --git a/src/wine-host/bridges/vst3.cpp b/src/wine-host/bridges/vst3.cpp index 7ef4440c..50d4c861 100644 --- a/src/wine-host/bridges/vst3.cpp +++ b/src/wine-host/bridges/vst3.cpp @@ -22,6 +22,7 @@ #include "vst3-impls/component-handler-proxy.h" #include "vst3-impls/host-context-proxy.h" +#include "vst3-impls/plug-frame-proxy.h" InstanceInterfaces::InstanceInterfaces() {} @@ -70,9 +71,13 @@ void Vst3Bridge::run() { main_context .run_in_context([&]() { // When the pointer gets dropped by the host, we want to - // drop it here as well + // drop it here as well, along with the `IPlugFrame` + // proxy object it may have received in + // `IPlugView::setFrame()`. object_instances[request.owner_instance_id] .plug_view.reset(); + object_instances[request.owner_instance_id] + .plug_frame_proxy.reset(); }) .wait(); diff --git a/src/wine-host/bridges/vst3.h b/src/wine-host/bridges/vst3.h index f90e45b5..620eb4d2 100644 --- a/src/wine-host/bridges/vst3.h +++ b/src/wine-host/bridges/vst3.h @@ -53,6 +53,16 @@ struct InstanceInterfaces { */ Steinberg::IPtr host_context_proxy; + /** + * If the host passes an `IPlugFrame` object during `IPlugView::setFrame()`, + * then we'll store a proxy object here and then pass it to + * `plug_view->setFrame()`. Will be initialized with a null pointer until + * used. When we destroy `plug_view` while handling + * `Vst3PlugViewProxy::Destruct`, we'll also destroy (our pointer of) this + * proxy object. + */ + Steinberg::IPtr plug_frame_proxy; + /** * After a call to `IEditController::setComponentHandler()`, we'll create a * proxy of that component handler just like we did for the plugin object.