13
0

Sync all_regions after region removal

The eventual goal is to keep the set of used regions
in sync, and allow to remove explicit calls to
`sync_all_regions_with_regions`.

This prevents `all_regions` to retain a reference to
a region that has been destroyed.
This commit is contained in:
Robin Gareus 2023-05-31 01:17:19 +02:00
parent bfed3f5d42
commit 5a0531df01
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -853,6 +853,20 @@ Playlist::remove_region_internal (std::shared_ptr<Region> region, ThawList& thaw
}
}
#if 0
for (set<std::shared_ptr<Region> >::iterator x = all_regions.begin(); x != all_regions.end(); ++x) {
if ((*x) == region) {
all_regions.erase (x);
break;
}
}
#else /* sync_all_regions_with_regions */
all_regions.clear ();
for (auto const& r: regions) {
all_regions.insert (r);
}
#endif
return -1;
}