Salome HOME
[bos #26726] EDF 24466 - CheckAndImprove generates wrong result. Fix SIGSEGV on Check...
authorjfa <jfa@opencascade.com>
Tue, 7 Dec 2021 08:39:02 +0000 (11:39 +0300)
committerjfa <jfa@opencascade.com>
Tue, 7 Dec 2021 08:39:02 +0000 (11:39 +0300)
src/GEOM_I/GEOM_IBlocksOperations_i.cc

index 3e8d270f2d3fce54095faf39b6dae55f0d1fb4d8..8a41e29c10ae34b20092c31176e8e233073da840 100644 (file)
@@ -626,16 +626,20 @@ CORBA::Boolean GEOM_IBlocksOperations_i::CheckCompoundOfBlocks
   Handle(::GEOM_Object) aCompound = GetObjectImpl(theCompound);
   if (aCompound.IsNull()) return isComp;
 
+  GEOM::GEOM_IBlocksOperations::BCErrors_var anErrArray =
+    new GEOM::GEOM_IBlocksOperations::BCErrors();
+
   //Check
   std::list<GEOMImpl_IBlocksOperations::BCError> errList;
   isComp = GetOperations()->CheckCompoundOfBlocks
     (aCompound, theToleranceC1, errList);
-  if (!GetOperations()->IsDone())
+  if (!GetOperations()->IsDone()) {
+    anErrArray->length(0);
+    theErrors = anErrArray._retn();
     return isComp;
+  }
 
   const int nbErr = errList.size();
-  GEOM::GEOM_IBlocksOperations::BCErrors_var anErrArray =
-    new GEOM::GEOM_IBlocksOperations::BCErrors();
   anErrArray->length(nbErr);
 
   // fill the local CORBA array with values from lists