From 6dd4e6a3eb7aaee7ecdbff8899919ec141d23fe2 Mon Sep 17 00:00:00 2001 From: jonjenssen Date: Thu, 14 Mar 2024 15:24:44 +0100 Subject: [PATCH] Crash fix: Iterator might be invalidated by erase, reorder operations. --- .../ProjectDataModel/Polygons/RimPolygonInViewCollection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ApplicationLibCode/ProjectDataModel/Polygons/RimPolygonInViewCollection.cpp b/ApplicationLibCode/ProjectDataModel/Polygons/RimPolygonInViewCollection.cpp index d964417218..5e54469ab5 100644 --- a/ApplicationLibCode/ProjectDataModel/Polygons/RimPolygonInViewCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/Polygons/RimPolygonInViewCollection.cpp @@ -222,8 +222,8 @@ void RimPolygonInViewCollection::syncPolygonsWithView() if ( it != existingPolygonsInView.end() ) { newPolygonsInView.push_back( *it ); - existingPolygonsInView.erase( it ); ( *it )->updateTargetsFromPolygon(); + existingPolygonsInView.erase( it ); } else {