[MOAB-dev] r4785 - MOAB/trunk/itaps/imesh

jvporter at wisc.edu jvporter at wisc.edu
Thu Apr 28 18:15:21 CDT 2011


Author: jvporter
Date: 2011-04-28 18:15:21 -0500 (Thu, 28 Apr 2011)
New Revision: 4785

Modified:
   MOAB/trunk/itaps/imesh/iMesh_MOAB.cpp
Log:
Fix some error handling in iMesh_createEnt (note that this doesn't fix any
failures in the unit tests)


Modified: MOAB/trunk/itaps/imesh/iMesh_MOAB.cpp
===================================================================
--- MOAB/trunk/itaps/imesh/iMesh_MOAB.cpp	2011-04-28 22:47:22 UTC (rev 4784)
+++ MOAB/trunk/itaps/imesh/iMesh_MOAB.cpp	2011-04-28 23:15:21 UTC (rev 4785)
@@ -1991,19 +1991,23 @@
                                              CONST_HANDLE_ARRAY_PTR(lower_order_entity_handles),
                                              lower_order_entity_handles_size,
                                              tmp_ent);
-    if (MB_SUCCESS != result)
-      *status = iBase_CREATION_FAILED;
-    else
-      *status = iBase_SUCCESS;
-    *new_entity_handle = reinterpret_cast<iBase_EntityHandle>(tmp_ent);
+    if (MB_SUCCESS == result) {
+      *new_entity_handle = reinterpret_cast<iBase_EntityHandle>(tmp_ent);
+      *status = iBase_NEW;
 
-    *err = *status;
+      if (MBIMESHI->AdjTable[5] || MBIMESHI->AdjTable[10]) {
+        Range set_ents;
+        set_ents.insert( tmp_ent );
+        create_int_ents(MBIMESHI, set_ents);
+      }
 
-    if (MB_SUCCESS == result && (MBIMESHI->AdjTable[5] || MBIMESHI->AdjTable[10])) {
-      Range set_ents;
-      set_ents.insert( tmp_ent );
-      create_int_ents(MBIMESHI, set_ents);
+      RETURN(iBase_SUCCESS);
     }
+    else {
+      *new_entity_handle = 0;
+      *status = iBase_CREATION_FAILED;
+      ERROR(result, "iMesh_createEnt: couldn't create entity");
+    }
   }
 
   void iMesh_deleteEnt(iMesh_Instance instance,















More information about the moab-dev mailing list