Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
comely13 opened this issue Jul 30, 2024 · 0 comments

Comments

@comely13
Copy link

`template void Tree::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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant