-
Notifications
You must be signed in to change notification settings - Fork 938
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
[AIST-QA] Fix memory leak issue in rdf_loader #1828
[AIST-QA] Fix memory leak issue in rdf_loader #1828
Conversation
- Correct the indication by the static analysis tool.
Thanks for pointing out this issue. I proposed a cleaner solution for this, avoiding new/delete completely in #1830. Closing here. |
Thank you for the review and for proposing a better way to fix it! |
My policy for such minor fixups is to apply them directly (particularly if I opened the source editor anyway to see the context). Usually I push those changes to the PR branch to keep them with the original PR. However, your PR was filed on an organizational account and github forbids pushing to those. |
Thank you! I understand that it's probably annoying for you to go back-and-forth with PRs instead of just fixing things immediately, but for us it's hard to justify our work if our PRs are apparently being rejected. We're trying our best to be as responsive as possible, so if it's not too much of a hassle, could we be allowed to modify this PR? |
Feel free to just fetch my additional changes in #1830 on top of your PR here. |
Thanks a lot! |
Sorry, I used the wrong type names. I hope, #1830 is fixed now (wait for Travis to finish). |
Thanks! The checks on #1830 passed, so I applied the changes to this PR. Thank you again so much for your understanding! |
Thanks. Please remove the unrelated cleanup in |
Got it. Sorry for the misunderstanding. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine with me if Travis is happy as well.
Use smart pointers to avoid explicit new/delete (and fix missing deletion of urdf model in error case). Explicitly express with the code that the internal pointers urdf_ and srdf_ should be initialized only if their initialization was successful.
Use smart pointers to avoid explicit new/delete (and fix missing deletion of urdf model in error case). Explicitly express with the code that the internal pointers urdf_ and srdf_ should be initialized only if their initialization was successful.
This ensures the color reset is applied because printing the color reset after new lines seems to preven the color from actually being reset. Co-authored-by: William Wedler <william.wedler@resquared.com>
Description
In the constructor of
RDFLoader
class, whenumodel
can not initialized, an error is shown and the constructor returns after showing an error message. In this case however, theumodel
variable is not deleted which causes a memory leak.This fix adds
delete umodel;
to the scope when constructor terminate prematurely.This contribution is made by AIST ( https://www.aist.go.jp ) based on static code analysis with klocwork (Perforce Software).
Checklist