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

VideoCapture leaking handles #4987

Open
opencv-pushbot opened this issue Jul 27, 2015 · 1 comment
Open

VideoCapture leaking handles #4987

opencv-pushbot opened this issue Jul 27, 2015 · 1 comment

Comments

@opencv-pushbot
Copy link
Contributor

Transferred from http://code.opencv.org/issues/4327

|| Jim Curry on 2015-05-09 17:17
|| Priority: Normal
|| Affected: branch 'master' (3.0-dev)
|| Category: highgui-camera
|| Tracker: Bug
|| Difficulty: 
|| PR: 
|| Platform: x64 / Windows

VideoCapture leaking handles

I am using OpenCV VideoCapture on Win 7-64 with Python 2.7.9 to capture images from several webcams. The code works but leaks handles severely. I have reduced the code to the snippet below and still see the leak. I have tried OpenCV versions 2.4.10 and 3.0.0rc1 and a version from about a year ago. This was originally asked at http://answers.opencv.org/ and I was advised to bring it here. Any ideas on how to correct this would be appreciated. Thanks.

<pre>
import cv2
def webcam():
    n=0
    while n<4:
        cap=cv2.VideoCapture(n)
        cap.release()
        cv2.waitKey(1)
        n=n+1
while True:
    webcam()
</pre>

History

Vadim Pisarevsky on 2015-05-14 18:35
Since you have the hardware configuration where you can reproduce the problem and we don't, I wonder if the problem exists in C++ version as well. I mean, we need to figure out whether it's highgui or python bindings problem
-   Category set to highgui-camera
Jim Curry on 2015-05-16 14:38
The issue does exist in C++ using both 2.4.10 and 3.0.0rc1.
Jim Curry on 2015-06-04 23:34
This issue is now confirmed in 2.4.11 and 3.0.0.
@venkat330
Copy link

Any updates or fixes on this bug??/

I am facing same issue under 👍
WIN7 + MINGW WIN32 + opencv2.4.11 / 3.0/2.4.6

Code sample: http://answers.opencv.org/question/68078/possible-memory-leak-cause-videocapture/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants