mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-31 19:07:43 +01:00
if snapshot is empty after creation, don't add it to the list
This commit is contained in:
parent
b14b9f352e
commit
426cbd0287
1 changed files with 13 additions and 0 deletions
|
|
@ -211,6 +211,12 @@ void MixerSnapshotManager::create_snapshot(std::string const& label, RouteList&
|
|||
snapshot->snap();
|
||||
}
|
||||
|
||||
//is this even possible? either way, sanity check
|
||||
if(snapshot->empty()) {
|
||||
delete snapshot;
|
||||
return;
|
||||
}
|
||||
|
||||
snapshot->set_label(label);
|
||||
snapshot->write(path);
|
||||
|
||||
|
|
@ -235,6 +241,13 @@ void MixerSnapshotManager::create_snapshot(std::string const& label, std::string
|
|||
ensure_snapshot_dir(global);
|
||||
const string path = global ? _global_path : _local_path;
|
||||
MixerSnapshot* snapshot = new MixerSnapshot(_session, from_path);
|
||||
|
||||
//clearly from_path doesn't point to a parsable state file
|
||||
if(snapshot->empty()) {
|
||||
delete snapshot;
|
||||
return;
|
||||
}
|
||||
|
||||
snapshot->set_label(label);
|
||||
snapshot->write(path);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue