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

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Wed Jan 20 12:55:06 CST 2010


Author: kraftche
Date: 2010-01-20 12:55:06 -0600 (Wed, 20 Jan 2010)
New Revision: 3450

Modified:
   cgm/trunk/geom/OCC/OCCModifyEngine.cpp
Log:
fix memory leak in make_Curve

Modified: cgm/trunk/geom/OCC/OCCModifyEngine.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCModifyEngine.cpp	2010-01-20 17:06:38 UTC (rev 3449)
+++ cgm/trunk/geom/OCC/OCCModifyEngine.cpp	2010-01-20 18:55:06 UTC (rev 3450)
@@ -306,7 +306,7 @@
   gp_Pnt pt;
   int size = 2+vector_list.size();
   TColgp_Array1OfPnt points(1, size);
-  CubitVector* vector = NULL;
+  CubitVector vector;
   CubitVector closest_location;
   for(int i = 1; i <= size; i++)
   {
@@ -314,23 +314,23 @@
      {
        TopoDS_Vertex *point = occ_point1->get_TopoDS_Vertex();
        pt = BRep_Tool::Pnt(*point);
-       vector = new CubitVector(point1_ptr->coordinates());
+       vector = point1_ptr->coordinates();
      }
      else if (i == size)
      {
        TopoDS_Vertex *point = occ_point2->get_TopoDS_Vertex();
        pt = BRep_Tool::Pnt(*point);
-       vector = new CubitVector(point2_ptr->coordinates()); 
+       vector = point2_ptr->coordinates(); 
      } 
      else
      {
-       vector = vector_list.get_and_step();
-       pt.SetCoord(vector->x(), vector->y(), vector->z());
+       vector = *vector_list.get_and_step();
+       pt.SetCoord(vector.x(), vector.y(), vector.z());
      } 
 
      if (occ_face != NULL)
      {
-       occ_face->closest_point(*vector, &closest_location);
+       occ_face->closest_point(vector, &closest_location);
        pt.SetCoord(closest_location.x(), closest_location.y(), closest_location.z()) ;  	 
      }
 



More information about the cgma-dev mailing list