[cgma-dev] r2837 - cgm/trunk/geom/OCC

jiangtao_ma at yahoo.com jiangtao_ma at yahoo.com
Fri Apr 17 14:48:56 CDT 2009


Author: janehu
Date: 2009-04-17 14:48:52 -0500 (Fri, 17 Apr 2009)
New Revision: 2837

Modified:
   cgm/trunk/geom/OCC/OCCCurve.cpp
   cgm/trunk/geom/OCC/OCCModifyEngine.cpp
   cgm/trunk/geom/OCC/OCCQueryEngine.cpp
Log:
Fixed valgrind for MkCyl and MkTwoCyls's definitely memory leaks and errors along with code check-in on MkCyl.cpp and MkTwoCyls.cpp.

Modified: cgm/trunk/geom/OCC/OCCCurve.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCCurve.cpp	2009-04-17 19:44:02 UTC (rev 2836)
+++ cgm/trunk/geom/OCC/OCCCurve.cpp	2009-04-17 19:48:52 UTC (rev 2837)
@@ -459,13 +459,20 @@
 		  CLP.Tangent(tangent);
 		  *tangent_ptr = CubitVector(tangent.X(), tangent.Y(), tangent.Z()); 
 	  }
+          else
+            *tangent_ptr = CubitVector(0, 0, 0);
     }
     if (curvature_ptr != NULL) 
+    {
+       *curvature_ptr = CubitVector(0, 0, 0);
        get_curvature( location, *curvature_ptr);
+    } 
   
     if (param != NULL) 
 	  *param = newVal;
   } 
+  else 
+    *param = -1;
   return CUBIT_SUCCESS;
 }
 

Modified: cgm/trunk/geom/OCC/OCCModifyEngine.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCModifyEngine.cpp	2009-04-17 19:44:02 UTC (rev 2836)
+++ cgm/trunk/geom/OCC/OCCModifyEngine.cpp	2009-04-17 19:48:52 UTC (rev 2837)
@@ -2247,6 +2247,8 @@
 	      BRepTools_WireExplorer Ex(wire); 
 	      for(; Ex.More(); Ex.Next())
 		list_of_edges.Append(Ex.Current());
+              edge_list->clean_out();
+              delete edge_list;
 	    }
 	}
       for(Itor.Initialize(list_of_edges); Itor.More(); Itor.Next())
@@ -2387,10 +2389,17 @@
 		    }
 		  splitor.Add(myWire.Wire(),from_face);
 		  topo_changed = CUBIT_TRUE; 
+                  edge_list->clean_out();
+                  delete edge_list;
+                  for(int i = 0; i <edge_lists.size(); i++)
+                  {
+                    edge_list = edge_lists.get_and_step();
+                    edge_list->clean_out();
+                    delete edge_list;
+                  }
 		  break;
 		}
-	      for(int iii = 0; iii < edge_list->size(); iii++)
-		edge_list->pop();
+	      edge_list->clean_out();
 	      delete edge_list;
 	    }
 	} 

Modified: cgm/trunk/geom/OCC/OCCQueryEngine.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCQueryEngine.cpp	2009-04-17 19:44:02 UTC (rev 2836)
+++ cgm/trunk/geom/OCC/OCCQueryEngine.cpp	2009-04-17 19:48:52 UTC (rev 2837)
@@ -159,7 +159,8 @@
   WireList = new DLIList<OCCLoop*>;
   SurfaceList = new DLIList<OCCSurface*>;
   CurveList = new DLIList<OCCCurve*>;
-  TCollection_ExtendedString xString;
+  CubitString name("Doc");
+  TCollection_ExtendedString xString((Standard_CString)name.c_str());
   MyDF = new TDocStd_Document(xString);
   mainLabel = MyDF->Main();
   EXPORT_ATTRIB = CUBIT_TRUE;



More information about the cgma-dev mailing list