-
Notifications
You must be signed in to change notification settings - Fork 42
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 more Animation memory leak #98
Conversation
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
Codecov Report
@@ Coverage Diff @@
## ign-common3 #98 +/- ##
===============================================
- Coverage 73.95% 73.94% -0.02%
===============================================
Files 69 69
Lines 9408 9408
===============================================
- Hits 6958 6957 -1
- Misses 2450 2451 +1
Continue to review full report at Codecov.
|
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.
LGTM, but I think we should remove raw pointers when porting forward. I can do this separately if you would like.
delete this->positionSpline; | ||
delete this->rotationSpline; | ||
for (auto kf : this->keyFrames) | ||
delete kf; |
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.
When bringing this patch forward to the main branch, let's change these to all use smart pointers. I don't think it's possible in a minor, because it would break ABI.
graphics/src/SkeletonAnimation.cc
Outdated
for (auto &it : this->data->animations) | ||
delete it.second; |
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.
These could also be replaced by smart pointers.
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.
yep done. c4c3a86
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.
Looks good, I agree with Michael about the smart pointers.
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
yeah that'll be great. The remaining one is protected variable so I'm not sure if it's possible to deprecate it or if we should just change the type. |
ign-common3 is in Ignition Dome so I think we should hold off on merging this until after the release |
ok common3 is stable. Merging after last round of CI builds |
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
Signed-off-by: Ian Chen <ichen@osrfoundation.org> Signed-off-by: Michael Carroll <michael@openrobotics.org>
Continuing the effort from pull request #93, this PR fixes memory leaks in the animation classes by deleting objects that are new'd and using smart pointer where possible
Signed-off-by: Ian Chen ichen@osrfoundation.org