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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:22:37+00:00 2026-06-14T05:22:37+00:00

When I analyze my iPhone app I have a blue arrow warning which says:

  • 0

When I analyze my iPhone app I have a blue arrow warning which says:

potential leak of an object stored into pauseImgBg

I simply crop a partial image from an atlas and put it into the pauseMenuIV imageView.

CGImageRef pauseImgBg = CGImageCreateWithImageInRect([UIImage imageNamed:@"atlas.png"].CGImage, CGRectMake(1, 1, 640.0f, 960.0f));
pauseMenu = [UIImage imageWithData:UIImagePNGRepresentation([UIImage imageWithCGImage:pauseImgBg])];// I have the blue arrow in this line
[pauseMenuIV setImage:pauseMenu];

What could be the problem ?
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-06-14T05:22:38+00:00Added an answer on June 14, 2026 at 5:22 am

    CGImageCreateWithImageInRect returns a CGImageRef with a retain count of +1. So you must release the recevied CGImageRef.

    CGImageRelease(pauseImgBg);
    

    in the end. Try and read the documentation when you have the time. It will help you to isolate these kinds of cases. From documentation

    Core Foundation functions have names that indicate when you own a
    returned object:

    • Object-creation functions that have “Create” embedded in the name
    • Object-duplication functions that have “Copy” embedded in the name.

    If you own an object, it is your responsibility to relinquish
    ownership when you have finished with it.

    And from the documentation of CGImageCreateWithImageInRect itself

    The resulting image retains a reference to the original image, which
    means you may release the original image after calling this function.

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

Sidebar

Related Questions

after Analyze my cocos2d game I've got an warning Potential leak of an object
I ran analyze on my 1st iPhone app, and I see a few potential
I have an iPhone application in the AppStore and I would like to analyze
Well i'm designing an iPhone app which will play video locally. When I click
I have been using Flurry.com to capture my analytical data for my iPhone app.
when i analyse my projetc, Xcode analyser find some potential leak of an object
I have an iPhone application which has some methods to gather information from the
I am trying to analyze a performance issue in my iPhone app with Instruments.
Dear iPhone Developers, I have an instance method which is meant to return a
I am attempting to analyze an iPhone application using the Leaks application and everything

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.