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

fixed a memory leak and contract violation #575

Merged
merged 1 commit into from
Dec 6, 2016
Merged

fixed a memory leak and contract violation #575

merged 1 commit into from
Dec 6, 2016

Conversation

ennerf
Copy link
Contributor

@ennerf ennerf commented Dec 5, 2016

OpenCVFrameGrabber .grab() leaks memory and fails the identity test. Fixed by pre-allocating the target Mat.

FrameGrabber grabber = new OpenCVFrameGrabber(0);
grabber.start();
while (true) {
     if (grabber.grab() != grabber.grab())
         throw new IllegalStateException();
}

@saudet
Copy link
Member

saudet commented Dec 6, 2016

Nice catch! Thanks

@saudet saudet merged commit 9476b19 into bytedeco:master Dec 6, 2016
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

2 participants