From ac6bcae28b7d30f046484db200c8b3bacba144a9 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Sun, 2 May 2021 19:04:46 +0200 Subject: [PATCH] Fix disconnecting VST3 connection points in Ardour We bypassed the proxies on `IConnectionPoint::connect()`, so we should of course be doing the same thing on `IConnectionPoint::disconnect()`.Z --- src/plugin/bridges/vst3-impls/plugin-proxy.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/plugin/bridges/vst3-impls/plugin-proxy.cpp b/src/plugin/bridges/vst3-impls/plugin-proxy.cpp index abf5908d..8d3cb2aa 100644 --- a/src/plugin/bridges/vst3-impls/plugin-proxy.cpp +++ b/src/plugin/bridges/vst3-impls/plugin-proxy.cpp @@ -468,12 +468,14 @@ tresult PLUGIN_API Vst3PluginProxyImpl::connect(IConnectionPoint* other) { Vst3ConnectionPointProxy::ConstructArgs(other, instance_id())}); } -tresult PLUGIN_API Vst3PluginProxyImpl::disconnect(IConnectionPoint* other) { - // See `Vst3PluginProxyImpl::connect()` - if (auto other_proxy = dynamic_cast(other)) { +tresult PLUGIN_API +Vst3PluginProxyImpl::disconnect(IConnectionPoint* /*other*/) { + // See `Vst3PluginProxyImpl::connect()`, if we directly connected two + // instances we'll also disconnect them again + if (connected_instance_id) { return bridge.send_message(YaConnectionPoint::Disconnect{ .instance_id = instance_id(), - .other_instance_id = other_proxy->instance_id()}); + .other_instance_id = *connected_instance_id}); } else { const tresult result = bridge.send_message( YaConnectionPoint::Disconnect{.instance_id = instance_id(),