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 7695081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:27:59+00:00 2026-05-31T21:27:59+00:00

I have enabled the static analyzer, but it is telling me that at the

  • 0

I have enabled the static analyzer, but it is telling me that at the end of that execution path that object didn’t get released, hence possibly causing a memory leak. I am however passing that reference to the created object to another class which will release it. I was wondering if there is a method or keyword to tell the compiled that I will release this object later.

I am looking for something like the auto-release.

By the way, I am using ARC.

I create the object like this:

CGMutablePathRef pathRef = CGPathCreateMutable();

And pass it like this:

self.flowView.pathToDraw = pathRef;

In my flowView class I have this method that will release it.

-(void) setPathToDraw:(CGMutablePathRef) newPath {
    if(pathToDraw!=NULL) CGPathRelease(pathToDraw);
    pathToDraw=newPath;
    [self setNeedsDisplay];
}

I already tried looking at the GCPath documentation but I had no luck.

Thanks

  • 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-31T21:28:01+00:00Added an answer on May 31, 2026 at 9:28 pm

    Yes, there is an extension for that:

    http://clang.llvm.org/docs/LanguageExtensions.html#objc_features

    You may declare your method as:

    - (void)setPathToDraw:(CGMutablePathRef) __attribute__((cf_consumed)) newPath
    

    and then Clang will recognize this (from the callsite — it fails to check that you do in fact consume it in the definition).

    You need to make sure that every selector which defines this adheres to the attribute you have applied for the selector (name).

    Attributes are risky – i recommend sticking to conventions where possible, and being extra cautious when dealing with dynamic dispatch. Here’s an example using ARC where the compiler can get it wrong. If the compiler gets it wrong, then the chances are good you will too because you’re working against the tools that are trying to help you.

    IIRC, consume is the only attribute I have used, and I use it exclusively with static dispatch.

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

Sidebar

Related Questions

I have enabled site-wide Django caching , but the third-party apps I am using
I have a combobox that I have Enabled = false. When that is the
I have a flash banner that I want to replace with a static image
We have an MTOM-enabled web service that is published with Grails and the Metro
We have the go button enabled but somehow we haven't been able to make
I have several domains that I would like to have wildcard subdomains enabled for
I have IIS 7.5 with static and dynamic compression enabled. It seems to work
I have a project that uses several static libraries and I keep getting errors
I have a form1 that opens form2 as a fake popup this.enabled = false;
I have hardware acceleration enabled in my app but I have disabled it for

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.