diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-07-04 20:07:01 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-07-04 20:07:01 +0400 |
commit | 7180551890cf3c417443b24a0f44a7f0dd7ea060 (patch) | |
tree | 806e46af7314ceed78c9cc7bc55a44fb61a57233 /extern/carve/include | |
parent | 4149ea5f50f74629cd9b220cfadcc69e2aa38281 (diff) |
fix for carve memory leak, update carve to hg bf36d92ff093
reported: http://code.google.com/p/carve/issues/detail?id=33
Diffstat (limited to 'extern/carve/include')
-rw-r--r-- | extern/carve/include/carve/csg.hpp | 56 | ||||
-rw-r--r-- | extern/carve/include/carve/polyline_decl.hpp | 5 | ||||
-rw-r--r-- | extern/carve/include/carve/rtree.hpp | 13 |
3 files changed, 44 insertions, 30 deletions
diff --git a/extern/carve/include/carve/csg.hpp b/extern/carve/include/carve/csg.hpp index db32273a33c..b098cd86cef 100644 --- a/extern/carve/include/carve/csg.hpp +++ b/extern/carve/include/carve/csg.hpp @@ -174,34 +174,34 @@ namespace carve { void groupIntersections(); - void _generateVertexVertexIntersections(carve::mesh::MeshSet<3>::vertex_t *va, - carve::mesh::MeshSet<3>::edge_t *eb); - void generateVertexVertexIntersections(carve::mesh::MeshSet<3>::face_t *a, - const std::vector<carve::mesh::MeshSet<3>::face_t *> &b); - - void _generateVertexEdgeIntersections(carve::mesh::MeshSet<3>::vertex_t *va, - carve::mesh::MeshSet<3>::edge_t *eb); - void generateVertexEdgeIntersections(carve::mesh::MeshSet<3>::face_t *a, - const std::vector<carve::mesh::MeshSet<3>::face_t *> &b); - - void _generateEdgeEdgeIntersections(carve::mesh::MeshSet<3>::edge_t *ea, - carve::mesh::MeshSet<3>::edge_t *eb); - void generateEdgeEdgeIntersections(carve::mesh::MeshSet<3>::face_t *a, - const std::vector<carve::mesh::MeshSet<3>::face_t *> &b); - - void _generateVertexFaceIntersections(carve::mesh::MeshSet<3>::face_t *fa, - carve::mesh::MeshSet<3>::edge_t *eb); - void generateVertexFaceIntersections(carve::mesh::MeshSet<3>::face_t *a, - const std::vector<carve::mesh::MeshSet<3>::face_t *> &b); - - void _generateEdgeFaceIntersections(carve::mesh::MeshSet<3>::face_t *fa, - carve::mesh::MeshSet<3>::edge_t *eb); - void generateEdgeFaceIntersections(carve::mesh::MeshSet<3>::face_t *a, - const std::vector<carve::mesh::MeshSet<3>::face_t *> &b); - - void generateIntersectionCandidates(carve::mesh::MeshSet<3> *a, + void _generateVertexVertexIntersections(meshset_t::vertex_t *va, + meshset_t::edge_t *eb); + void generateVertexVertexIntersections(meshset_t::face_t *a, + const std::vector<meshset_t::face_t *> &b); + + void _generateVertexEdgeIntersections(meshset_t::vertex_t *va, + meshset_t::edge_t *eb); + void generateVertexEdgeIntersections(meshset_t::face_t *a, + const std::vector<meshset_t::face_t *> &b); + + void _generateEdgeEdgeIntersections(meshset_t::edge_t *ea, + meshset_t::edge_t *eb); + void generateEdgeEdgeIntersections(meshset_t::face_t *a, + const std::vector<meshset_t::face_t *> &b); + + void _generateVertexFaceIntersections(meshset_t::face_t *fa, + meshset_t::edge_t *eb); + void generateVertexFaceIntersections(meshset_t::face_t *a, + const std::vector<meshset_t::face_t *> &b); + + void _generateEdgeFaceIntersections(meshset_t::face_t *fa, + meshset_t::edge_t *eb); + void generateEdgeFaceIntersections(meshset_t::face_t *a, + const std::vector<meshset_t::face_t *> &b); + + void generateIntersectionCandidates(meshset_t *a, const face_rtree_t *a_node, - carve::mesh::MeshSet<3> *b, + meshset_t *b, const face_rtree_t *b_node, face_pairs_t &face_pairs, bool descend_a = true); @@ -287,7 +287,7 @@ namespace carve { * @param[out] out_loops A list of grouped face loops. */ void groupFaceLoops( - carve::mesh::MeshSet<3> *src, + meshset_t *src, FaceLoopList &face_loops, const detail::LoopEdges &loop_edges, const V2Set &no_cross, diff --git a/extern/carve/include/carve/polyline_decl.hpp b/extern/carve/include/carve/polyline_decl.hpp index a29c56656ff..5934dd25a34 100644 --- a/extern/carve/include/carve/polyline_decl.hpp +++ b/extern/carve/include/carve/polyline_decl.hpp @@ -138,6 +138,11 @@ namespace carve { PolylineSet(const std::vector<carve::geom3d::Vector> &points); PolylineSet() { } + ~PolylineSet() { + for (line_iter i = lines.begin(); i != lines.end(); ++i) { + delete *i; + } + } template<typename iter_t> void addPolyline(bool closed, iter_t begin, iter_t end); diff --git a/extern/carve/include/carve/rtree.hpp b/extern/carve/include/carve/rtree.hpp index 77f93c14e08..65d46e5a48d 100644 --- a/extern/carve/include/carve/rtree.hpp +++ b/extern/carve/include/carve/rtree.hpp @@ -49,8 +49,6 @@ namespace carve { aabb_t getAABB() const { return bbox; } - - struct data_aabb_t { aabb_t bbox; data_t data; @@ -164,6 +162,17 @@ namespace carve { _fill(begin, end, typename std::iterator_traits<iter_t>::value_type()); } + ~RTreeNode() { + if (child) { + RTreeNode *next = child; + while (next) { + RTreeNode *curr = next; + next = next->sibling; + delete curr; + } + } + } + // functor for ordering nodes by increasing aabb midpoint, along a specified axis. |