javaos74 / btstack

Automatically exported from code.google.com/p/btstack
0 stars 0 forks source link

Memory leak for run_loop_cocoa #281

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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.

Original issue reported on code.google.com by raizh...@gmail.com on 22 Aug 2012 at 10:11