memory leak in cv:VideoWriter::write() ( iOS ) (Bug #2918)
Description
this function loses memory each time is called ; after some frames , the app crashes
Associated revisions
Merge pull request #2918 from vbystricky:oclopt_reduce2
History
Updated by Alessandro Trebbi almost 12 years ago
Alessandro Trebbi wrote:
this function loses memory each time is called ; after some frames , the app crashes
I think the bug is here:
cap_avfoundation.mm line 1295
CFDataRef cfData = CGDataProviderCopyData(CGImageGetDataProvider(cgImage));
cfData should be released after use
Updated by Vladislav Vinogradov almost 12 years ago
Thanks for your report.
Could you provide a fix for this issue? See How_to_contribute page for instructions.
- Category set to highgui-video
- Assignee set to Vadim Pisarevsky
Updated by Alessandro Trebbi almost 12 years ago
I did not manage to test it, but this should work:
cap_avfoundation.mm line 1317 i added 2 lines ( i added to release, i'm not sure that both are required )
//cleanup- NSLog(@"Patch alessandro trebbi");
CFRelease(cfData);
CVPixelBufferRelease(pixelBuffer);*
CGImageRelease(cgImage);
CGDataProviderRelease(provider);
CGColorSpaceRelease(colorSpace);
( i tried to fix it by myself, but did not manage to compile a functional framework, i mean the framework i comoile give me many link errors due to duplicate symbols )
Updated by Alessandro Trebbi almost 12 years ago
Please assign the bug to me, i have already fixed, and then will do a pull request. thx
Updated by Nguyen Nguyen almost 10 years ago
Alessandro Trebbi wrote:
I did not manage to test it, but this should work:
cap_avfoundation.mm line 1317 i added 2 lines ( i added to release, i'm not sure that both are required )
//cleanup
- NSLog(@"Patch alessandro trebbi");
CFRelease(cfData);
CVPixelBufferRelease(pixelBuffer);*
CGImageRelease(cgImage);
CGDataProviderRelease(provider);
CGColorSpaceRelease(colorSpace);( i tried to fix it by myself, but did not manage to compile a functional framework, i mean the framework i comoile give me many link errors due to duplicate symbols )
I tried it on the latest 2.4 branch, the leak is still there.
Updated by Maksim Shabunin over 9 years ago
Issue has been transferred to GitHub: https://github.com/Itseez/opencv/issues/4537