-
Notifications
You must be signed in to change notification settings - Fork 90
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 that not to delete some objects after destroying functions #236
Fix that not to delete some objects after destroying functions #236
Conversation
Signed-off-by: Chen.Lihui <lihui.chen@sony.com>
besides, cppcheck looks unhappy for windows and macOS. could you look into it? |
I encounter that before (in some previous PR), but It seems that maintainers not decide to deal with them. Such as,
|
It isn't being ignored so much as that cppcheck is disagreeing with correct code and fixing it turns out to not be so trivial (see #220). And @iuhilnehc-ynos and @fujitatomoya thank you for all the work! I look forward to the final touches on the PR so that it can be merged. |
Signed-off-by: Chen.Lihui <lihui.chen@sony.com> Co-authored-by: Tomoya.Fujita <Tomoya.Fujita@sony.com>
Thanks for your information. I'll also keep my eyes on it and try to get a method to fix it. |
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
No idea, sorry... |
I don't know if we need to explicitly add
|
Next step, I think I need to check |
After using cppcheck(2.1) at ubuntu, it failed with the same error(unknownMacro), I believe that using concrete "-I path" for cppcheck is a feature of v2.1 compared with v1.9. (Sorry about not looking into cppcheck source.) So the patch about using 'set(ament_cmake_cppcheck_ADDITIONAL_INCLUDE_DIRS ${rcutils_INCLUDE_DIRS})' in CMakeLists.txt seems one solution. (Why not updating About |
Note that we have an overall problem with cppcheck 2.1: ros2/ros2#942 . Because of that, we are currently pinned to cppcheck 1.9 on all platforms. |
That's good to know. |
Could you please review it? (I hope you got a happy mood.) |
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.
Hi @iuhilnehc-ynos there are three things:
- I am embarrassed by the number of memory leaks
- In the long run, it would probably be worth it to rely more heavily on
unique_ptr
s - And there's one thing I suggest changing in the PR, it doesn't actually fix anything but I think it may help in the future.
Thank you!
Signed-off-by: Chen.Lihui <lihui.chen@sony.com> Co-authored-by: eboasson <eb@ilities.com>
I used the
After using Could you please review it again? Thank you. |
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.
@iuhilnehc-ynos it looks good to me, thank you! @ivanpauno or @hidmic I'd appreciate it if you could take a final look because I don't quite trust myself with C++ just yet ...
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 with one minor question
Signed-off-by: Chen.Lihui <lihui.chen@sony.com>
Fixes #235
Signed-off-by: Chen.Lihui lihui.chen@sony.com