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<ARDOUR::Port>) + 1140
This commit is contained in:
Robin Gareus 2020-12-29 16:01:00 +01:00
parent 9ba8166ae8
commit 3f60d12308
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04

View file

@ -1823,12 +1823,20 @@ PluginPinWidget::sc_input_press (GdkEventButton *ev, boost::weak_ptr<ARDOUR::Por
} }
#endif #endif
RouteList copy = _session->get_routelist ();
copy.sort (Stripable::Sorter(true));
uint32_t added = 0; 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) { if (added > 0) {
citems.push_back (SeparatorElem ()); citems.push_back (SeparatorElem ());