From 1e424e11460812262df89c08c6af521a935760cf Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 28 Nov 2009 02:39:16 +0000 Subject: [PATCH] All plugin activate() method when required for copy & paste operations. Fixes segfaults on drag and drop of plugins between routes. git-svn-id: svn://localhost/ardour2/branches/3.0@6203 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/plugin_insert.cc | 5 ++--- libs/ardour/route.cc | 4 ++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc index 6957d55f57..f41d6bbc25 100644 --- a/libs/ardour/plugin_insert.cc +++ b/libs/ardour/plugin_insert.cc @@ -89,6 +89,8 @@ PluginInsert::PluginInsert (Session& s, const XMLNode& node) throw failed_constructor(); } + _pending_active = _active; + { Glib::Mutex::Lock em (_session.engine().process_lock()); IO::PortCountChanged (max(input_streams(), output_streams())); @@ -718,7 +720,6 @@ PluginInsert::set_state(const XMLNode& node, int version) } if (prop->value() == X_("ladspa") || prop->value() == X_("Ladspa")) { /* handle old school sessions */ - cout << "- LADSPA\n"; type = ARDOUR::LADSPA; } else if (prop->value() == X_("lv2")) { type = ARDOUR::LV2; @@ -752,8 +753,6 @@ PluginInsert::set_state(const XMLNode& node, int version) } } - cout << "- ID " << prop->value() << "\n"; - boost::shared_ptr plugin; plugin = find_plugin (_session, prop->value(), type); diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 1b8dfaec46..facc507133 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -1014,6 +1014,10 @@ Route::add_processors (const ProcessorList& others, ProcessorList::iterator iter _processors.insert (iter, *i); + if ((*i)->active()) { + (*i)->activate (); + } + if (configure_processors_unlocked (err)) { ++existing_end; _processors.erase (existing_end, _processors.end());