From 3f60d12308c325c72933e26a03fa17e203a46bfc Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 29 Dec 2020 16:01:00 +0100 Subject: [PATCH] Handle async removal of sidechain input Apparently a user managed to remove a SC input and then use the input's context-menu before the UI had caught up. (PluginPinWidget::plugin_reconfigured happens during idle) --- Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000 Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 [..] PluginPinWidget::sc_input_press(_GdkEventButton*, boost::weak_ptr) + 1140 --- gtk2_ardour/plugin_pin_dialog.cc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/gtk2_ardour/plugin_pin_dialog.cc b/gtk2_ardour/plugin_pin_dialog.cc index 6cd353f5dd..9d937648d6 100644 --- a/gtk2_ardour/plugin_pin_dialog.cc +++ b/gtk2_ardour/plugin_pin_dialog.cc @@ -1823,12 +1823,20 @@ PluginPinWidget::sc_input_press (GdkEventButton *ev, boost::weak_ptrget_routelist (); - copy.sort (Stripable::Sorter(true)); uint32_t added = 0; - for (ARDOUR::RouteList::const_iterator i = copy.begin (); i != copy.end (); ++i) { - added += maybe_add_route_to_input_menu (*i, p->type (), wp); + + if (p) { + RouteList copy = _session->get_routelist (); + copy.sort (Stripable::Sorter (true)); + for (ARDOUR::RouteList::const_iterator i = copy.begin (); i != copy.end (); ++i) { + added += maybe_add_route_to_input_menu (*i, p->type (), wp); + } } +#if 0 + else { + queue_idle_update (): + } +#endif if (added > 0) { citems.push_back (SeparatorElem ());