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

Python imgmsg_to_cv2 memory leak #34

Closed
cburbridge opened this issue Apr 15, 2014 · 3 comments
Closed

Python imgmsg_to_cv2 memory leak #34

cburbridge opened this issue Apr 15, 2014 · 3 comments

Comments

@cburbridge
Copy link

When using the imgmsg_to_cv2 function from Python cv_bridge.CvBridge class, memory is leaked if colour conversion is performed. I am using the latest Hydro release, code like this:

    def image_cb(self, image):
            try:
                ## This leaks, using colour conversion:
                #self._image = self.bridge.imgmsg_to_cv2(image, "bgr8")
                ## This works, no conversions:
                self._image = self.bridge.imgmsg_to_cv2(image)
            except CvBridgeError, e:
                print e

Looking at the refcounts for self._image.block, they are screwed up when using colour conversion and fine otherwise. Am I just missing something?

vrabaud added a commit that referenced this issue Apr 15, 2014
@vrabaud
Copy link
Contributor

vrabaud commented Apr 15, 2014

Hi, can you please confirm that this patch works ? thx

@cburbridge
Copy link
Author

Yep, fixed, and incredibly fast :-) Thanks.

@vrabaud
Copy link
Contributor

vrabaud commented Apr 16, 2014

cool ! Releasing for all releases then. Memory leaks need to be fixed fast :)

@vrabaud vrabaud closed this as completed Apr 16, 2014
vrabaud added a commit that referenced this issue Apr 16, 2014
luca-della-vedova pushed a commit to luca-della-vedova/vision_opencv that referenced this issue Sep 2, 2020
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

No branches or pull requests

2 participants