Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VTK
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Rhodanos
VTK
Commits
89802bd1
Commit
89802bd1
authored
7 years ago
by
Mathieu Westphal (Kitware)
Browse files
Options
Downloads
Patches
Plain Diff
Fix some memory leaks in vtkSphereTree and cleanup api
parent
6fd5b316
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Common/ExecutionModel/vtkSphereTree.cxx
+12
-16
12 additions, 16 deletions
Common/ExecutionModel/vtkSphereTree.cxx
Common/ExecutionModel/vtkSphereTree.h
+1
-1
1 addition, 1 deletion
Common/ExecutionModel/vtkSphereTree.h
with
13 additions
and
17 deletions
Common/ExecutionModel/vtkSphereTree.cxx
+
12
−
16
View file @
89802bd1
...
...
@@ -1079,21 +1079,13 @@ vtkSphereTree::vtkSphereTree()
vtkSphereTree
::~
vtkSphereTree
()
{
this
->
SetDataSet
(
nullptr
);
if
(
this
->
Selected
)
{
delete
[]
this
->
Selected
;
this
->
Selected
=
nullptr
;
}
delete
[]
this
->
Selected
;
delete
this
->
Hierarchy
;
if
(
this
->
Tree
)
{
{
this
->
Tree
->
Delete
();
this
->
Tree
=
nullptr
;
}
if
(
this
->
Hierarchy
)
{
delete
this
->
Hierarchy
;
this
->
Hierarchy
=
nullptr
;
}
}
}
//================General tree methods========================================
...
...
@@ -1134,13 +1126,18 @@ void vtkSphereTree::Build(vtkDataSet *input)
//----------------------------------------------------------------------------
// Compute the sphere tree leafs (i.e., spheres around each cell)
v
tkDoubleArray
*
vtkSphereTree
::
BuildTreeSpheres
(
vtkDataSet
*
input
)
v
oid
vtkSphereTree
::
BuildTreeSpheres
(
vtkDataSet
*
input
)
{
// See if anything has to be done
if
(
this
->
Tree
!=
nullptr
&&
this
->
BuildTime
>
this
->
MTime
)
{
return
this
->
Tree
;
return
;
}
else
if
(
this
->
Tree
!=
nullptr
)
{
this
->
Tree
->
Delete
();
delete
[]
this
->
Selected
;
}
// Allocate
//
...
...
@@ -1171,8 +1168,6 @@ vtkDoubleArray *vtkSphereTree::BuildTreeSpheres(vtkDataSet *input)
}
this
->
BuildTime
.
Modified
();
return
newScalars
;
}
//----------------------------------------------------------------------------
...
...
@@ -1368,6 +1363,7 @@ BuildUnstructuredHierarchy(vtkDataSet *input, double *tree)
// We are ready to create the hierarchy
vtkUnstructuredHierarchy
*
h
;
delete
this
->
Hierarchy
;
//cleanup if necessary
this
->
Hierarchy
=
h
=
new
vtkUnstructuredHierarchy
(
dims
,
bds
,
spacing
,
numCells
);
vtkIdType
*
cellLoc
=
h
->
CellLoc
,
*
cellMap
=
h
->
CellMap
;
...
...
This diff is collapsed.
Click to expand it.
Common/ExecutionModel/vtkSphereTree.h
+
1
−
1
View file @
89802bd1
...
...
@@ -217,7 +217,7 @@ protected:
vtkTimeStamp
BuildTime
;
//time at which tree was built
// Supporting methods
v
tkDoubleArray
*
BuildTreeSpheres
(
vtkDataSet
*
input
);
v
oid
BuildTreeSpheres
(
vtkDataSet
*
input
);
void
ExtractCellIds
(
const
unsigned
char
*
selected
,
vtkIdList
*
cellIds
,
vtkIdType
numSelected
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment