• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
CFBridgingRetain does not leak memory
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: CFBridgingRetain does not leak memory
      • From: Ken Thomases <email@hidden>
  • Prev by Date: Make a version of NSData "rangeOfData: options: range:" for multiple search parameters
  • Next by Date: Re: CFBridgingRetain does not leak memory
  • Previous by thread: Re: Make a version of NSData "rangeOfData: options: range:" for multiple search parameters
  • Next by thread: Re: CFBridgingRetain does not leak memory
  • Index(es):
    • Date
    • Thread