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:
parent
bfed3f5d42
commit
5a0531df01
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user