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

resize.cpp: fix memory leak #489

Merged
merged 1 commit into from Jan 7, 2020

Conversation

furushchev
Copy link
Contributor

Instantiating cv::Mat without passing custom data storage in callback function causes memory leak on the end of callback function.
This PR fixes the issue by using toCvShare method to re-use data storage of image_msg for an original image and a class member variable scaled_cv_ which holds cv::Mat as a member for a scaled image instead of implicitly initializing cv::Mat.

@JWhitleyWork JWhitleyWork merged commit b51c168 into ros-perception:melodic Jan 7, 2020
mikeferguson pushed a commit that referenced this pull request Jan 19, 2024
Related with this PR in ROS 1
#489

Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
ahcorde added a commit that referenced this pull request Jan 19, 2024
Related with this PR in ROS 1
#489

Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
ahcorde added a commit that referenced this pull request Jan 19, 2024
Related with this PR in ROS 1
#489

Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
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.

None yet

3 participants