From ac9bc1976234f6cf8b732e237192834ad43c8e81 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 1 Mar 2017 18:52:40 +0100 Subject: [PATCH] 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. --- libs/ardour/route.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index b6f4f5fad7..44d7958740 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -907,6 +907,12 @@ Route::add_processors (const ProcessorList& others, boost::shared_ptr ProcessorList::iterator loc; boost::shared_ptr 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 ()) {