diff options
author | Robin Gareus <robin@gareus.org> | 2020-05-19 18:04:40 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-05-19 18:08:28 +0200 |
commit | 61d11347b6f72f1ad3b4f161bf368e8113d40751 (patch) | |
tree | 0c4eec5c2375cdf5e9f123bec49c6d655736437d /libs/ardour/session.cc | |
parent | 3a9bf57af964f6a83f5b6c59b1e363e12ea92598 (diff) |
Remove implicit saves when removing empty sources
This fixes an implicit save when importing files.
The Track's disk-reader is initially created with an empty
source which is later replaced and dropped:
ARDOUR::Session::save_state
ARDOUR::Session::remove_source
PBD::Destructible::drop_references
ARDOUR::DiskWriter::reset_write_sources
ARDOUR::DiskWriter::set_write_source_name
ARDOUR::Track::set_name
Editor::finish_bringing_in_material
Diffstat (limited to 'libs/ardour/session.cc')
-rw-r--r-- | libs/ardour/session.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index c3672b0d39..6a99053f1f 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -4456,15 +4456,23 @@ Session::remove_source (boost::weak_ptr<Source> src) if ((i = sources.find (source->id())) != sources.end()) { sources.erase (i); SourceRemoved (src); /* EMIT SIGNAL */ + } else { + return; } } - if (!in_cleanup () && !loading ()) { + if (source->empty ()) { + /* No need to save when empty sources are removed. + * This is likely due to disk-writer initial dummies + * where files don't even exist on disk. + */ + return; + } + if (!in_cleanup () && !loading ()) { /* save state so we don't end up with a session file * referring to non-existent sources. */ - save_state (); } } |