mayo icon indicating copy to clipboard operation
mayo copied to clipboard

After removing the node in "libtree.h", only the node is marked as true, and the node content "data" is not completely removed.

Open comely13 opened this issue 7 months ago • 0 comments

`template<typename T> void Tree<T>::removeRoot(TreeNodeId id) { Expects(this->nodeIsRoot(id));

// TODO Mark all deep children nodes as 'deleted'
auto it = std::find(m_vecRoot.begin(), m_vecRoot.end(), id);
if (it != m_vecRoot.end()) {
    TreeNode* node = this->ptrNode(id);
    Expects(node != nullptr);
    node->isDeleted = true;
    m_vecRoot.erase(it);
}

}` In this part, if the model is opened repeatedly and then removed, the node content is not completely deleted, which will cause the memory to continue to increase.

comely13 avatar Jul 30 '24 08:07 comely13