fix crash when freezing a track with > 1 region (#9539)

deleting regionviews changed the region selection, but the regionview
ptr had not been removed from the RegionViewList. The selection change signal
caused an iteration over the list, and manipulated the deleted regionview.
This commit is contained in:
Paul Davis 2023-11-20 19:11:30 -07:00
parent e010cf91b9
commit 4647dd6b41

View File

@ -227,14 +227,12 @@ StreamView::remove_region_view (std::weak_ptr<Region> weak_r)
void
StreamView::undisplay_track ()
{
for (RegionViewList::iterator i = region_views.begin(); i != region_views.end() ; ) {
RegionViewList::iterator next = i;
++next;
delete *i;
i = next;
}
RegionViewList copy (region_views);
region_views.clear ();
region_views.clear();
for (auto const & rv : copy) {
delete rv;
}
}
void