13
0

Fix crash when trying to undo region operations across source deletion

Record, move recorded region(s), delete the recorded source, undo.

Undo would undo the region-move, of a region that no longer
exists and has no source.
This commit is contained in:
Robin Gareus 2023-05-31 15:46:59 +02:00
parent f58f5bef55
commit f3ee7fdf88
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -4649,11 +4649,13 @@ Session::remove_source (std::weak_ptr<Source> src, bool drop_references)
SourceRemoved (src); /* EMIT SIGNAL */
if (drop_references) {
/* It would not matter to recurse here, the
* source was already removed from the sources.
* But there is no need to take the source_lock again.
*/
printf ("Source->drop_references!\n");
source->drop_references ();
/* Removing a Source cannot be undone.
* We need to clear all undo commands that reference the
* removed source - or just clear all of the undo history.
*/
_history.clear();
}
assert (!source->used ());