Revision: 57053
          http://sourceforge.net/p/brlcad/code/57053
Author:   phoenixyjll
Date:     2013-08-22 03:43:21 +0000 (Thu, 22 Aug 2013)
Log Message:
-----------
Don't use explicit dynamic memory allocation for curvesarray, in case that we 
forget to delete it. Use ON_ClassArray instead.

Modified Paths:
--------------
    brlcad/trunk/src/libbrep/boolean.cpp

Modified: brlcad/trunk/src/libbrep/boolean.cpp
===================================================================
--- brlcad/trunk/src/libbrep/boolean.cpp        2013-08-22 03:30:32 UTC (rev 
57052)
+++ brlcad/trunk/src/libbrep/boolean.cpp        2013-08-22 03:43:21 UTC (rev 
57053)
@@ -1004,7 +1004,7 @@
 {
     int facecount1 = brepA->m_F.Count();
     int facecount2 = brepB->m_F.Count();
-    ON_SimpleArray<ON_Curve*> *curvesarray = new ON_SimpleArray<ON_Curve*> 
[facecount1 + facecount2];
+    ON_ClassArray<ON_SimpleArray<ON_Curve*> > curvesarray(facecount1 + 
facecount2);
 
     // calculate intersection curves
     for (int i = 0; i < facecount1; i++) {
@@ -1113,7 +1113,6 @@
 
     if (trimmedfaces.Count() != original_faces.Count()) {
        bu_log("ON_Boolean() Error: trimmedfaces.Count() != 
original_faces.Count()\n");
-       delete [] curvesarray;
        return -1;
     }
 
@@ -1218,7 +1217,6 @@
     bu_log(ON_String(ws).Array());
 
     // WIP
-    delete [] curvesarray;
     return 0;
 }
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to