CFBridgingRetain does not leak memory
CFBridgingRetain does not leak memory
- Subject: CFBridgingRetain does not leak memory
- From: Tamas Nagy <email@hidden>
- Date: Fri, 15 Apr 2016 11:34:03 +0200
Hello,
I have an ongoing project where I’m using a CFMessagePort some sort of IPC communication. The CFMessagePort has a callback, something like this:
static CFDataRef Callback(CFMessagePortRef port,
SInt32 messageID,
CFDataRef data,
void *info)
{
return CFBridgingRetain([NSArchiver archivedDataWithRootObject:[(__bridge AppDelegate *)info getParameters]]);
}
The Callback runs on the main queue, it has been setup with CFMessagePortSetDispatchQueue(localPort, dispatch_get_main_queue());
The interesting part is, and I don’t know why is this happening, CFBridgingRetain does not leak memory here - checked out with Instruments, also let the app run for a couple of hours, and memory usage does not increased (check out in Activity Monitor). Should not that CFBridgingRetain leak memory in this example, since I’m retaining a CF object and not releasing it by CFRelease?
Thanks!
Best,
Tamas
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden