Fix remove_source assert()

With empty MIDI regions it can happen that the GUI
still retains a reference (rec_regions)
This commit is contained in:
Robin Gareus 2023-06-04 21:26:41 +02:00
parent 1feb9b5e89
commit ad5d355fb5
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -4657,7 +4657,6 @@ Session::remove_source (std::weak_ptr<Source> src, bool drop_references)
*/
_history.clear();
}
assert (!source->used ());
if (source->empty ()) {
/* No need to save when empty sources are removed.
@ -4667,6 +4666,8 @@ Session::remove_source (std::weak_ptr<Source> src, bool drop_references)
return;
}
assert (!source->used ());
if (!in_cleanup () && !loading ()) {
/* save state so we don't end up with a session file
* referring to non-existent sources.