From 61b6b740bc445a133e0b39a9200193304bd1ddf4 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 25 Feb 2020 22:55:59 +0100 Subject: [PATCH] Fix deadlock, shared_ptr d'tor called from ScopedConnectionList d'tor See https://ardour.org/styleguide.html #10 https://pastebin.com/gJfrNhL2 --- libs/surfaces/websockets/feedback.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libs/surfaces/websockets/feedback.cc b/libs/surfaces/websockets/feedback.cc index f7591fb33d..6e956f8f61 100644 --- a/libs/surfaces/websockets/feedback.cc +++ b/libs/surfaces/websockets/feedback.cc @@ -68,8 +68,12 @@ struct PluginBypassObserver { struct PluginParamValueObserver { void operator() (ArdourFeedback* p, uint32_t strip_n, uint32_t plugin_n, - uint32_t param_n, boost::shared_ptr control) + uint32_t param_n, boost::weak_ptr ctrl) { + boost::shared_ptr control = ctrl.lock (); + if (!control) { + return; + } p->update_all (Node::strip_plugin_param_value, strip_n, plugin_n, param_n, ArdourStrips::plugin_param_value (control)); } @@ -221,7 +225,7 @@ ArdourFeedback::observe_strip_plugin_param_values (uint32_t strip_n, control->Changed.connect (_signal_connections, MISSING_INVALIDATOR, boost::bind (PluginParamValueObserver (), this, strip_n, plugin_n, param_n, - control), + boost::weak_ptr(control)), event_loop ()); } }