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 (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to