Merge lp:~massing/dolfin/1.0.x-massing into lp:dolfin/1.0.x

Proposed by Andre Massing
Status: Merged
Approved by: Garth Wells
Approved revision: 6546
Merged at revision: 6546
Proposed branch: lp:~massing/dolfin/1.0.x-massing
Merge into: lp:dolfin/1.0.x
Diff against target: 34 lines (+10/-1)
1 file modified
dolfin/intersection/IntersectionOperatorImplementation.h (+10/-1)
To merge this branch: bzr merge lp:~massing/dolfin/1.0.x-massing
Reviewer Review Type Date Requested Status
Garth Wells Pending
Review via email: mp+128788@code.launchpad.net

Description of the change

Fixes memory leak in IntersectionOperator (#923028)

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'dolfin/intersection/IntersectionOperatorImplementation.h'
2--- dolfin/intersection/IntersectionOperatorImplementation.h 2011-11-15 03:00:12 +0000
3+++ dolfin/intersection/IntersectionOperatorImplementation.h 2012-10-09 18:50:37 +0000
4@@ -18,7 +18,7 @@
5 // Modified by Johannes Ring, 2009.
6 //
7 // First added: 2009-09-11
8-// Last changed: 2011-11-11
9+// Last changed: 2012-10-09
10
11 #ifndef __INTERSECTIONOPERATORIMPLEMENTATION_H
12 #define __INTERSECTIONOPERATORIMPLEMENTATION_H
13@@ -55,6 +55,9 @@
14 // Only default constructor, since the search tree has a dimension dependent type, hence encapsulates in the
15 // inheriting IntersectionOperatorImplementation_d!
16
17+ // Virtual destructor
18+ virtual ~IntersectionOperatorImplementation() {}
19+
20 virtual void all_intersected_entities(const Point & point, std::set<uint> & ids_result) const = 0;
21 virtual void all_intersected_entities(const std::vector<Point> & points, std::set<uint> & ids_result) const = 0;
22
23@@ -98,6 +101,12 @@
24 build_tree(labels, label);
25 }
26
27+ /// Destructor which ensures to reset AABB tree
28+ virtual ~IntersectionOperatorImplementation_d()
29+ {
30+ tree.reset();
31+ }
32+
33 virtual void all_intersected_entities(const Point& point, std::set<uint>& ids_result) const;
34 virtual void all_intersected_entities(const std::vector<Point>& points, std::set<uint>& ids_result) const;
35

Subscribers

People subscribed via source and target branches