Revision: 73152
          http://sourceforge.net/p/brlcad/code/73152
Author:   starseeker
Date:     2019-05-23 13:17:58 +0000 (Thu, 23 May 2019)
Log Message:
-----------
We may need to manipulate the ON_Brep - work on a copy

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

Modified: brlcad/trunk/src/libbrep/cdt.cpp
===================================================================
--- brlcad/trunk/src/libbrep/cdt.cpp    2019-05-23 12:14:48 UTC (rev 73151)
+++ brlcad/trunk/src/libbrep/cdt.cpp    2019-05-23 13:17:58 UTC (rev 73152)
@@ -355,7 +355,7 @@
     ON_wString wstr;
     ON_TextLog tl(wstr);
 
-    ON_Brep* brep = s_cdt->brep;
+    ON_Brep* brep = new ON_Brep(*s_cdt->brep);
 
     brep->ShrinkSurfaces();
 
@@ -363,6 +363,7 @@
     ON_wString wonstr;
     ON_TextLog vout(wonstr);
     if (!brep->IsValid(&vout)) {
+       delete brep;
        bu_log("brep is NOT valid, cannot produce watertight mesh\n");
        //return -1;
     }
@@ -371,7 +372,8 @@
     for (int index = 0; index < brep->m_E.Count(); index++) {
         ON_BrepEdge& edge = brep->m_E[index];
         if (edge.TrimCount() != 2) {
-            bu_log("Edge %d trim count: %d - can't (yet) do watertight 
meshing\n", edge.m_edge_index, edge.TrimCount());
+           delete brep;
+           bu_log("Edge %d trim count: %d - can't (yet) do watertight 
meshing\n", edge.m_edge_index, edge.TrimCount());
             return -1;
         }
     }
@@ -752,6 +754,7 @@
 cdt_done:
     bu_free(valid_faces, "faces");
     bu_free(valid_vertices, "vertices");
+    delete brep;
 
     if (invalid) {
        return 1;

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



_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to