From: Carl Hetherington Date: Tue, 1 Dec 2009 02:36:31 +0000 (+0000) Subject: Revert completely mystifying stupidity in a previous patch of mine, and (properly... X-Git-Tag: 3.0-alpha5~2681 X-Git-Url: https://git.carlh.net/gitweb/?a=commitdiff_plain;h=4ee4be1550f24cc2328a205e04a55b970c1d57e0;p=ardour.git Revert completely mystifying stupidity in a previous patch of mine, and (properly) fix crashes when drag-and-drop of plugins fails because of impossible configurations. git-svn-id: svn://localhost/ardour2/branches/3.0@6237 d708f5d6-7413-0410-9779-e7cbd77b26cf --- diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index d57f542bc4..6879eee5e5 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -985,8 +985,6 @@ Route::add_processors (const ProcessorList& others, ProcessorList::iterator iter { Glib::RWLock::WriterLock lm (_processor_lock); - ProcessorList::iterator existing_end = _processors.end(); - --existing_end; ChanCount potential_max_streams = ChanCount::max (_input->n_ports(), _output->n_ports()); @@ -1012,15 +1010,14 @@ Route::add_processors (const ProcessorList& others, ProcessorList::iterator iter } } - _processors.insert (iter, *i); + ProcessorList::iterator inserted = _processors.insert (iter, *i); if ((*i)->active()) { (*i)->activate (); } if (configure_processors_unlocked (err)) { - ++existing_end; - _processors.erase (existing_end, _processors.end()); + _processors.erase (inserted); configure_processors_unlocked (0); // it worked before we tried to add it ... return -1; } @@ -1473,15 +1470,6 @@ Route::configure_processors_unlocked (ProcessorStreams* err) } } - /* Take the process lock so that if we add a processor which increases the required - number of scratch buffers, we create those scratch buffers before the process - thread has a chance to ask for them. - XXX: in an ideal world we'd perhaps use some RCU magic to avoid having to take - the lock here. - */ - - Glib::Mutex::Lock pl (_session.engine().process_lock ()); - // We can, so configure everything list< pair >::iterator c = configuration.begin(); for (ProcessorList::iterator p = _processors.begin(); p != _processors.end(); ++p, ++c) {