Corrected wrong deallocation when octree was destroyed after being never used.

This commit is contained in:
Paolo Cignoni 2007-05-10 10:48:49 +00:00
parent 01277711b6
commit 9fee0bfaaa
1 changed files with 5 additions and 1 deletions

View File

@ -214,9 +214,13 @@ namespace vcg
};
public:
Octree()
{
marks=0;
}
~Octree()
{
delete []marks;
if(marks) delete []marks;
int node_count = TemplatedOctree::NodeCount();
for (int i=0; i<node_count; i++)
delete TemplatedOctree::nodes[i];