diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc index 75e54e4b66..0c97c59ae4 100644 --- a/gtk2_ardour/processor_box.cc +++ b/gtk2_ardour/processor_box.cc @@ -516,6 +516,10 @@ ProcessorBox::choose_send () ios->show_all (); + /* bit of a hack; keep a shared_ptr to send around so that it doesn't get deleted while + the IOSelectorWindow is doing its stuff */ + _send_being_created = send; + boost::shared_ptr r = boost::static_pointer_cast(send); ios->selector().Finished.connect (bind (mem_fun(*this, &ProcessorBox::send_io_finished), boost::weak_ptr(r), ios)); @@ -526,6 +530,9 @@ ProcessorBox::send_io_finished (IOSelector::Result r, boost::weak_ptr { boost::shared_ptr processor (weak_processor.lock()); + /* now we can lose the dummy shared_ptr */ + _send_being_created.reset (); + if (!processor) { return; } diff --git a/gtk2_ardour/processor_box.h b/gtk2_ardour/processor_box.h index 6d57230cf8..e47c28ec10 100644 --- a/gtk2_ardour/processor_box.h +++ b/gtk2_ardour/processor_box.h @@ -94,6 +94,9 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject bool ab_direction; std::vector connections; + /// a send that is in the process of creation + boost::shared_ptr _send_being_created; + ARDOUR::Placement _placement; PluginSelector & _plugin_selector;