Fix crash when adding a plugin immediately after re-order (via script)

The re-order is queued to be performed click-free in realtime-context.
Meanwhile adding plugins will result in a race-condition.
This commit is contained in:
Robin Gareus 2017-03-01 18:52:40 +01:00
parent 96b3f8ec92
commit ac9bc19762
1 changed files with 6 additions and 0 deletions

View File

@ -907,6 +907,12 @@ Route::add_processors (const ProcessorList& others, boost::shared_ptr<Processor>
ProcessorList::iterator loc;
boost::shared_ptr <PluginInsert> fanout;
if (g_atomic_int_get (&_pending_process_reorder)) {
/* we need to flush any pending re-order changes */
Glib::Threads::Mutex::Lock lx (AudioEngine::instance()->process_lock ());
apply_processor_changes_rt ();
}
if (before) {
loc = find(_processors.begin(), _processors.end(), before);
if (loc == _processors.end ()) {