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

Fix a memory-leak in RootNode::deleteChildOrTile() #1956

Merged

Conversation

danrbailey
Copy link
Contributor

The address sanitizer CI picked up that there was a memory leak in the RootNode::deleteChildOrTile() method and I realize that the NodeStruct doesn't delete the child on destruction so I've fixed this by explicitly deleting it.

I also added a warning that this method will invalidate existing iterators as previously requested.

(@kmuseth)

Copy link
Contributor

@jmlait jmlait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see.... the RootNode::NodeStruct::set method will delete the existing child, which means the clip methods:
setTile(this->findCoord(xyz), bgTile); // delete any existing child node first
mTable.erase(xyz);
would be implicitly deleting the child in the setTile method.

@danrbailey danrbailey merged commit 8a81dbb into AcademySoftwareFoundation:master Oct 30, 2024
40 checks passed
@danrbailey danrbailey deleted the root_delete_fix branch October 30, 2024 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants