From cb85080ca8e8a1f23cd9017587fe48a66c442274 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 10 Sep 2015 11:23:12 -0400 Subject: [PATCH] fix deadlock when removing routes and using JACK1. graph reorder callback needed an early exit if we were deleting routes, is all. --- libs/ardour/session.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 91578c9b17..94a12ca504 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -3346,6 +3346,8 @@ Session::add_internal_send (boost::shared_ptr dest, boost::shared_ptr routes_to_remove) { + PBD::Unwinder uw_flag (_route_deletion_in_progress, true); + { // RCU Writer scope RCUWriter writer (routes); boost::shared_ptr rs = writer.get_copy (); @@ -3441,7 +3443,6 @@ Session::remove_routes (boost::shared_ptr routes_to_remove) /* try to cause everyone to drop their references * and unregister ports from the backend */ - PBD::Unwinder uw_flag (_route_deletion_in_progress, true); for (RouteList::iterator iter = routes_to_remove->begin(); iter != routes_to_remove->end(); ++iter) { (*iter)->drop_references (); @@ -4878,7 +4879,7 @@ Session::graph_reordered () from a set_state() call or creating new tracks. Ditto for deletion. */ - if ((_state_of_the_state & (InitialConnecting|Deletion)) || _adding_routes_in_progress || _reconnecting_routes_in_progress) { + if ((_state_of_the_state & (InitialConnecting|Deletion)) || _adding_routes_in_progress || _reconnecting_routes_in_progress || _route_deletion_in_progress) { return; }