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

jiangtao_ma at yahoo.com jiangtao_ma at yahoo.com
Tue Apr 7 14:42:18 CDT 2009


Author: janehu
Date: 2009-04-07 14:42:16 -0500 (Tue, 07 Apr 2009)
New Revision: 2805

Modified:
   cgm/trunk/geom/OCC/OCCCoEdge.cpp
   cgm/trunk/geom/OCC/OCCCoEdge.hpp
   cgm/trunk/geom/OCC/OCCLoop.cpp
Log:
Fixed memory error for calling coedge->loop() in disconnect_curves function, at this point, the coedges have been deleted.

Modified: cgm/trunk/geom/OCC/OCCCoEdge.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCCoEdge.cpp	2009-04-06 21:58:02 UTC (rev 2804)
+++ cgm/trunk/geom/OCC/OCCCoEdge.cpp	2009-04-07 19:42:16 UTC (rev 2805)
@@ -64,6 +64,11 @@
   return OCCQueryEngine::instance();
 }
 
+LoopSM* OCCCoEdge::loop()
+{
+  return myLoop;
+}
+
 void OCCCoEdge::append_simple_attribute_virt(CubitSimpleAttrib* csattrib_ptr)
 {
 }

Modified: cgm/trunk/geom/OCC/OCCCoEdge.hpp
===================================================================
--- cgm/trunk/geom/OCC/OCCCoEdge.hpp	2009-04-06 21:58:02 UTC (rev 2804)
+++ cgm/trunk/geom/OCC/OCCCoEdge.hpp	2009-04-07 19:42:16 UTC (rev 2805)
@@ -60,8 +60,7 @@
     
   inline void set_curve(Curve* curve) {myCurve = curve;}
 
-  inline LoopSM* loop() const { if(myLoop)return myLoop;
-                                else return NULL; }
+  LoopSM* loop(); 
 
   inline void set_loop(LoopSM * loop) {myLoop = loop;}
 

Modified: cgm/trunk/geom/OCC/OCCLoop.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCLoop.cpp	2009-04-06 21:58:02 UTC (rev 2804)
+++ cgm/trunk/geom/OCC/OCCLoop.cpp	2009-04-07 19:42:16 UTC (rev 2805)
@@ -85,13 +85,6 @@
 //-------------------------------------------------------------------------
 void OCCLoop::disconnect_all_curves()
 {
-  myCoEdgeList.reset();
-  for (int i = myCoEdgeList.size(); i--; )
-  {
-    OCCCoEdge* coedge = myCoEdgeList.get_and_step();
-    OCCLoop *loop = CAST_TO(coedge->loop(), OCCLoop);
-    assert(loop == this);
-  }
   myCoEdgeList.clean_out();
 }
 



More information about the cgma-dev mailing list