| Summary: | Memory leak in Cocoa_GetDisplayName | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Diego <diegoacevedo91> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED WONTFIX | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | HG 2.0 | ||
| Hardware: | x86_64 | ||
| OS: | Mac OS X (All) | ||
| Attachments: |
Leak code
Leak code CGDisplayIOServicePort workaround |
||
|
Description
Diego
2014-06-14 02:07:02 UTC
Nice catch! I think this is fixed, can you verify? https://hg.libsdl.org/SDL/rev/49562091afe1 Instruments is still reporting the leak. Is there any more information I can give you? Can you investigate further? I'm not very familiar with the Cocoa and native type bridging, and we're not building in ARC mode. Maybe we need to do both CFRelease and NSDictionary release? Created attachment 1691 [details]
Leak code
Created attachment 1692 [details]
Leak code CGDisplayIOServicePort workaround
I've tried several times but have not been successful in fixing the leak. I haven't been able find any information on the internet about IODisplayCreateInfoDictionary leaking. I submitted a bug report to Apple. I'll update this post as Apple updates the bug status. I'd like to know if other people see this leak. Creating a new Xcode 5 project and replacing the code in main.m with the attached main.m code causes the leak on Instruments Leak tool. CGDisplayIOServicePort is deprecated with no replacement. I found a workaround for CGDisplayIOServicePort but that made no difference. main_CGDisplayIOServicePort_workaround.m is the workaround code. io_object_t's like io_service_t can be released with IOObjectRelease() but that's not the problem either. IODisplayCreateInfoDictionary does not leak if you give it a wrong servicePort. Such as changing servicePort to equal 0. Okay, since this appears to be an Apple bug, I'll leave it for now. Feel free to reopen this, if there's a bug fix from Apple or we missed something. Thanks! It does appear to be an Apple bug. I got this message today from my Apple bug report. "Engineering has determined that your bug report is a duplicate of another issue and will be closed." The duplicate bug report is still in an open status. So it sounds like there's nothing we can do until they fix it. Okay, thanks for the update! |