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 memory leak when rl::sg::ode::Shape is destroyed #92

Merged
merged 4 commits into from
Sep 13, 2024

Conversation

ahgnuoy
Copy link
Contributor

@ahgnuoy ahgnuoy commented Aug 22, 2024

I discovered a memory leak when destroying rl::sg::ode::Scene. Upon investigation, I found that the ::dTriMeshDataID created during the creation of rl::sg::ode::Shape was not being destroyed. To correct this, I modified the code as follows.

@rickertm
Copy link
Member

rickertm commented Sep 8, 2024

Thank you very much for pointing this out. Could you please initialize the data member to nullptr in the member initializer list and move it to private? Without the initialization, this creates an exception for the other shape types and it should not be accessible publicly.

@rickertm
Copy link
Member

Thank you for adding the initialization, the tests work correctly now. Could you please update the data member to use alphabetical order within the private section?

@rickertm rickertm merged commit 4a8e401 into roboticslibrary:master Sep 13, 2024
10 of 11 checks passed
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

Successfully merging this pull request may close these issues.

2 participants