From a9e6d5e7a72fedc2d777536073733e8df6e4b31f Mon Sep 17 00:00:00 2001 From: piacibel <cyrille.piacibello@inria.fr> Date: Mon, 24 Nov 2014 11:28:06 +0100 Subject: [PATCH] minor fix in delete --- Src/Containers/FSubOctree.hpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Src/Containers/FSubOctree.hpp b/Src/Containers/FSubOctree.hpp index 07e92fc61..fecf26afe 100755 --- a/Src/Containers/FSubOctree.hpp +++ b/Src/Containers/FSubOctree.hpp @@ -51,7 +51,7 @@ template< class CellClass , class ContainerClass, class LeafClass, class CellAll class FAbstractSubOctree { protected: - CellClass*** cells; //< Potential cells, cells are allocated only if needed + CellClass*** cells; //< Potential cells, cells are allocated only if needed FAbstractSubOctree* const parent; //< Parent suboctree (null for root) const int indexInParent; //< This is the index of the current octree in the parent's array @@ -60,7 +60,7 @@ protected: int rightLeafIndex; //< The leaf at the right position (this is the last array index when iterate) const int subOctreeHeight; //< Height of this suboctree - const int subOctreePosition; //< Level of the current suboctree in the global tree (0 if node) + const int subOctreePosition; //< Level of the current suboctree in the global tree (0 if node) const bool isLeafSubtree; //< To know if a subtree is leaf or not (we prefere that to a virtual method) @@ -135,8 +135,12 @@ protected: // Manage border limits if(arrayIndex == this->leftLeafIndex && arrayIndex == this->rightLeafIndex){ - this->rightLeafIndex = -1; + this->rightLeafIndex = -1; // only one cells, return true + // remove the last cells + cellAllocator.deleteObject(this->cells[indexLevel][arrayIndex]); + this->cells[indexLevel][arrayIndex] =nullptr; + return true; } else if(arrayIndex == this->leftLeafIndex){ @@ -631,4 +635,3 @@ public: #endif //FSUBOCTREE_HPP - -- GitLab