Export to GitHub

btstack - issue #281

Memory leak for run_loop_cocoa


Posted on Aug 22, 2012 by Massive Bird

What steps will reproduce the problem? 1. add timer for cocoa application 2. use instruments to detect memory leak 3. there is memory leak when timer execute

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system? btstack version is r1672

and provide any additional information below. I think the problem exist in cocoa_add_timer: CFRunLoopTimerRef timerRef = CFRunLoopTimerCreate (kCFAllocatorDefault,fireDate,0,0,0,theCFRunLoopTimerCallBack,&timerContext); CFRetain(timerRef); //this line should be removed.

after I removed CFRetain(timerRef), no leak.

Status: New

Labels:
Type-Defect Priority-Medium