From 587439acf88ad8e57d832b5dd7cd60c41405c595 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 29 Sep 2016 13:05:38 -0400 Subject: [PATCH] fix crash on OS X el capitan when using command line arguments --- gtk2_ardour/ardour_ui.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index d5498a2fc6..62043ead74 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -3125,7 +3125,19 @@ ARDOUR_UI::build_session_from_dialog (SessionDialog& sd, const std::string& sess void ARDOUR_UI::load_from_application_api (const std::string& path) { + /* OS X El Capitan (and probably later) now somehow passes the command + line arguments to an app via the openFile delegate protocol. Ardour + already does its own command line processing, and having both + pathways active causes crashes. So, if the command line was already + set, do nothing here. + */ + + if (!ARDOUR_COMMAND_LINE::session_name.empty()) { + return; + } + ARDOUR_COMMAND_LINE::session_name = path; + /* Cancel SessionDialog if it's visible to make OSX delegates work. * * ARDOUR_UI::starting connects app->ShouldLoad signal and then shows a SessionDialog -- 2.30.2