summaryrefslogtreecommitdiff
path: root/libs/ardour/session_state.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2020-01-30 21:05:48 +0100
committerRobin Gareus <robin@gareus.org>2020-01-30 21:08:02 +0100
commitd887f5965abcc2f95b672593c06d10aab65c1d9f (patch)
tree2b7d2cc801c91c265b1160643f20c9efc2af7d24 /libs/ardour/session_state.cc
parentd4f816c158bba2f7eed2934ccd9cd5376d209d94 (diff)
Fix assert() when removing track(s)
ARDOUR::Session::remove_routes() explicitly calls save_state (_current_snapshot_name) Update assert() to treat an empty name equivalently as explicitly specified _current_snapshot_name
Diffstat (limited to 'libs/ardour/session_state.cc')
-rw-r--r--libs/ardour/session_state.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index 5b6a0b0435..87584ce89c 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -765,9 +765,9 @@ Session::save_state (string snapshot_name, bool pending, bool switch_to_snapshot
/* 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));
+ assert (!switch_to_snapshot || (!snapshot_name.empty () && snapshot_name != _current_snapshot_name && !pending && !template_only && !for_archive));
/* pending saves are for current snapshot only */
- assert (!pending || (snapshot_name.empty () && !template_only && !for_archive));
+ assert (!pending || ((snapshot_name.empty () || snapshot_name == _current_snapshot_name) && !template_only && !for_archive));
XMLTree tree;
std::string xml_path(_session_dir->root_path());
@@ -786,7 +786,7 @@ Session::save_state (string snapshot_name, bool pending, bool switch_to_snapshot
if (g_atomic_int_get(&_suspend_save)) {
/* StateProtector cannot be used for templates or save-as */
- assert (!template_only && !switch_to_snapshot && !for_archive && snapshot_name.empty ());
+ assert (!template_only && !switch_to_snapshot && !for_archive && (snapshot_name.empty () || snapshot_name == _current_snapshot_name));
if (pending) {
_save_queued_pending = true;
} else {