]> OCCT Git - occt.git/commitdiff
0026306: Access to deleted object in ShapeFix_FixSmallSolid
authorabv <abv@opencascade.com>
Wed, 3 Jun 2015 07:01:40 +0000 (10:01 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 4 Jun 2015 11:44:08 +0000 (14:44 +0300)
Code corrected to avoid accessing element of sequence by reference after it is removed.

src/ShapeFix/ShapeFix_FixSmallSolid.cxx

index 64a3c01e524554344b481d09cc23da56d6b16b9a..70a82bcd42138cbf61d31300aa20e22d9cffdd1a 100644 (file)
@@ -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();