diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 8384eee208..9c602c57e2 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -53,6 +53,7 @@ #include "pbd/stl_delete.h" #include "pbd/file_utils.h" #include "pbd/localtime_r.h" +#include "pbd/pthread_utils.h" #include "gtkmm2ext/application.h" #include "gtkmm2ext/bindings.h" @@ -2718,6 +2719,13 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri break; default: if (quit_on_cancel) { + // JE - Currently (July 2014) this section can only get reached if the + // user quits from the main 'Session Setup' dialog (i.e. reaching this + // point does NOT indicate an abnormal termination). Therefore, let's + // behave gracefully (i.e. let's do some cleanup) before we call exit() + ARDOUR::cleanup (); + pthread_cancel_all (); + exit (1); } else { return ret;