Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6574199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:13:49+00:00 2026-05-25T15:13:49+00:00

I have the following (adapted from Apple Low Level File Management – Resolving Aliases)

  • 0

I have the following (adapted from Apple Low Level File Management – Resolving Aliases)

NSString *resolvedPath = nil;
...
resolvedPath = (NSString*)CFURLCopyFileSystemPath(resolvedUrl, kCFURLPOSIXPathStyle);
...
return resolvedPath;

Build & Analyse generates the following warning:-

194:3 Potential leak (when using garbage collection) of an object allocated on line 187 and stored into 'resolvedPath'

The detail states:-

187:32 Call to function 'CFURLCopyFileSystemPath' returns a Core Foundation object with a +1 retain count (owning reference).  Core Foundation objects are not automatically garbage collected

194:3 Object returned to caller as an owning reference (single retain count transferred to caller)

194:3 Object allocated on line 187 and stored into 'resolvedPath' and returned from method 'getTarget:' is potentially leaked when using garbage collection.  Callers of this method do not expect a returned object with a +1 retain count since they expect the object to be managed by the garbage collector

Do I have a memory leak?

If so how do I fix it?

If not how do I prevent the warnings?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T15:13:50+00:00Added an answer on May 25, 2026 at 3:13 pm

    Do I have a memory leak?

    you should assume it is a leak. in GC, the allocation of a cf type is not guaranteed to be registered with the collector. GC only covers a range of types (explicit objc objects). you should assume cf types which you create or copy are not registered with the collector. whether you are returned a cftype from a cf function that is or is not registered with the collector is not disclosed (it may be because an ns type is a cf type).

    If so how do I fix it?

    using CFMakeCollectable or NSMakeCollectable

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So: I have the following function, adapted from a formula found online, which takes
I have the following code adapted from a previous question/answer: var str = $('title').text();
I have the following script (adapted from here) for uploading files via ftp for
I have the following instance method (adapted from Listing 3-6 of the Event Handling
I have implemented the following code (adapted from the tutorial ) in order to
I have following text in a file 23456789 When I tried to replace the
I wonder whether someone can help me please. I have the following xml file
I have the following: SELECT * FROM pages WHERE parent=0 ORDER BY `sort` ASC
Following suggestions on this site, I have adopted SimpleXML from org.simpleframework.xml. I use this
Really stumped on this one. I have the following PHP file with a variable

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.