memory leak in cv:VideoWriter::write() ( iOS ) (Bug #2918)


Added by Alessandro Trebbi almost 12 years ago. Updated over 9 years ago.


Status:Open Start date:2013-03-25
Priority:Normal Due date:
Assignee:Vadim Pisarevsky % Done:

0%

Category:highgui-video
Target version:-
Affected version:2.4.4 Operating System:
Difficulty: HW Platform:
Pull request:

Description

this function loses memory each time is called ; after some frames , the app crashes


Associated revisions

Revision e169083f
Added by Alexander Alekhin over 10 years ago

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

Also available in: Atom PDF