diff options
author | Robin Gareus <robin@gareus.org> | 2020-02-25 22:55:59 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-02-25 22:55:59 +0100 |
commit | 61b6b740bc445a133e0b39a9200193304bd1ddf4 (patch) | |
tree | fbb0505e1102d7cfb6e31be9b9533b8dd77cb854 /libs | |
parent | bcfe16610ac588dffb5b639b033d60fa59a29717 (diff) |
Fix deadlock, shared_ptr d'tor called from ScopedConnectionList d'tor
See https://ardour.org/styleguide.html #10
https://pastebin.com/gJfrNhL2
Diffstat (limited to 'libs')
-rw-r--r-- | libs/surfaces/websockets/feedback.cc | 8 |
1 files 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<AutomationControl> control) + uint32_t param_n, boost::weak_ptr<AutomationControl> ctrl) { + boost::shared_ptr<AutomationControl> 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<void> (PluginParamValueObserver (), this, strip_n, plugin_n, param_n, - control), + boost::weak_ptr<AutomationControl>(control)), event_loop ()); } } |