From 71a83ed199dbec678da82229b0caba57ddf82db0 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 22 Jun 2023 04:50:43 +0200 Subject: [PATCH] Fix heap-use-after-free when toggling manual pin-control When toggling "Manual Config", Route::customize_plugin_insert() or Route::reset_plugin_insert() emits processors_changed. This destroyed the widget from which the change was initiated, in ppw.clear(), leading to a use-after-free in ArdourButton::on_button_release_event(_GdkEventButton*) ../libs/widgets/ardour_button.cc:995 The PluginPinDialog does not need to refill the widget list when manual config is toggled, only the PluginPinWidget itself needs to updated. --- gtk2_ardour/plugin_pin_dialog.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/plugin_pin_dialog.cc b/gtk2_ardour/plugin_pin_dialog.cc index aa04b5cd02..108f1f2b8a 100644 --- a/gtk2_ardour/plugin_pin_dialog.cc +++ b/gtk2_ardour/plugin_pin_dialog.cc @@ -2147,8 +2147,11 @@ PluginPinDialog::map_height (Gtk::Allocation&) } void -PluginPinDialog::route_processors_changed (ARDOUR::RouteProcessorChange) +PluginPinDialog::route_processors_changed (ARDOUR::RouteProcessorChange c) { + if (c.type == RouteProcessorChange::CustomPinChange) { + return; + } ppw.clear (); _height_mapped = false; scroller->remove ();