From c816d34d68a70fbc42f3d6edded49e999fffd575 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 9 Feb 2017 12:39:44 +0100 Subject: explanatory comment and logic change to cover when we switch to the new session after save-as --- gtk2_ardour/ardour_ui.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 2b9624b663..e5b13c821c 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -2665,7 +2665,15 @@ ARDOUR_UI::save_session_as () msg.run (); } - if (!sa.include_media) { + /* the logic here may seem odd: why isn't the condition sa.switch_to ? + * the trick is this: if the new session was copy with media included, + * then Session::save_as() will have already done a neat trick to avoid + * us having to unload and load the new state. But if the media was not + * included, then this is required (it avoids us having to otherwise + * drop all references to media (sources). + */ + + if (!sa.include_media && sa.switch_to) { unload_session (false); load_session (sa.final_session_folder_name, sa.new_name); hide_splash (); -- cgit v1.2.3