summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2020-01-30 04:09:48 +0100
committerRobin Gareus <robin@gareus.org>2020-01-30 04:09:48 +0100
commit998fadda573f7e6b1432bba2ed3b2b555d358964 (patch)
tree07a8d6493080947ca20e882023b1162d99ae9170 /libs/ardour
parent6452f62d64cfc473a4fce9a027d31ed56368d8cb (diff)
Add some sanity checks for Session::save parameters
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/session_state.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index 9986aa2752..e7b1a29d3e 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -760,6 +760,15 @@ Session::save_state (string snapshot_name, bool pending, bool switch_to_snapshot
{
DEBUG_TRACE (DEBUG::Locale, string_compose ("Session::save_state locale '%1'\n", setlocale (LC_NUMERIC, NULL)));
+ /* only_used_assets is only possible when archiving */
+ assert (!only_used_assets || for_archive);
+ /* template and archive are exclusive */
+ assert (!template_only || !for_archive);
+ /* switch_to_snapshot needs a new name and can't be pending */
+ assert (!switch_to_snapshot || (!snapshot_name.empty () && !pending && !template_only && !for_archive));
+ /* pending saves are for current snapshot only */
+ assert (!pending || (snapshot_name.empty () && !template_only && !for_archive));
+
XMLTree tree;
std::string xml_path(_session_dir->root_path());