From: abv Date: Wed, 3 Jun 2015 07:01:40 +0000 (+0300) Subject: 0026306: Access to deleted object in ShapeFix_FixSmallSolid X-Git-Tag: V7_0_0_beta~509 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=81a023ab8c953f8af9294012c77929768969c9ce;p=occt.git 0026306: Access to deleted object in ShapeFix_FixSmallSolid Code corrected to avoid accessing element of sequence by reference after it is removed. --- diff --git a/src/ShapeFix/ShapeFix_FixSmallSolid.cxx b/src/ShapeFix/ShapeFix_FixSmallSolid.cxx index 64a3c01e52..70a82bcd42 100644 --- a/src/ShapeFix/ShapeFix_FixSmallSolid.cxx +++ b/src/ShapeFix/ShapeFix_FixSmallSolid.cxx @@ -455,8 +455,9 @@ TopoDS_Shape ShapeFix_FixSmallSolid::Merge ( // remove the small solid theContext->Remove (aSmallSolid); - aSmallSolids.Remove (aSolidIter); SendWarning ( aSmallSolid, Message_Msg( "ShapeFix.FixSmallSolid.MSG1" )); + + aSmallSolids.Remove (aSolidIter); } else aSolidIter.Next();