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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:36:36+00:00 2026-06-17T06:36:36+00:00

I am trying to understand why instruments is saying the indicated lines in the

  • 0

I am trying to understand why instruments is saying the indicated lines in the following code is causing dirty memory growth. I am getting this in my second heap shot (after the baseline) after returning to the baseline state. Can anyone point out my error?

CCSprite *baseSprite = NULL;
CCSprite *mainHandSprite = NULL;
CCSprite *offHandSprite = NULL;
CCSprite *helmetSprite = NULL;
CCSprite *torsoSprite = NULL;
CCSprite *gloveSprite = NULL;
CCSprite *bootSprite = NULL;

NSString* afile = [NSString stringWithFormat:@"%@%i.PNG", file, num];
baseSprite = [[CCSprite alloc]initWithFile:afile];   /* HEAP GROWTH */
baseSprite.anchorPoint = ccp(0,0);

int w = baseSprite.textureRect.size.width;
int h = baseSprite.textureRect.size.height;

mainHandSprite = [self mainHandSprite:file And:num];
helmetSprite = [self headSprite:file And:num];
torsoSprite = [self torsoSprite:file And:num];
offHandSprite = [self shieldSprite:file And:num];
gloveSprite = [self gloveSprite:file And:num];
bootSprite = [self bootSprite:file And:num];

CCRenderTexture *rt = [CCRenderTexture renderTextureWithWidth:w height:h]; /*HEAP GROWTH */

[rt begin];

[baseSprite visit];
if (torsoSprite)
    [torsoSprite visit];
if (helmetSprite)
    [helmetSprite visit];
if (offHandSprite)
    [offHandSprite visit];
if (bootSprite)
    [bootSprite visit];
if (gloveSprite)
    [gloveSprite visit];
if (mainHandSprite)
    [mainHandSprite visit];

[rt end];

CCTexture2D *aTex = rt.sprite.texture;
[aTex setAntiAliasTexParameters];

[baseSprite release];
baseSprite = NULL;
[mainHandSprite release];
mainHandSprite = NULL;
[torsoSprite release];
torsoSprite = NULL;
[helmetSprite release];
helmetSprite = NULL;
[offHandSprite release];
offHandSprite = NULL;
[gloveSprite release];
gloveSprite = NULL;
[bootSprite release];
bootSprite = NULL;

return aTex;
  • 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-17T06:36:38+00:00Added an answer on June 17, 2026 at 6:36 am

    The message just states where the instance is created not where it is leaked.

    The variable baseSprite is retained elsewhere without a balancing release.

    For rt either CCRenderTexture returns an un-autoreleased object or the variable is retained elsewhere without a balancing release.

    If you need to see where retains, releases and autoreleases occur for an object use instruments:

    Run in instruments, in Allocations set “Record reference counts” on on (you have to stop recording to set the option). Cause the problem code to run, stop recording, search for there ivar of interest, drill down and you will be able to see where all retains, releases and autoreleases occurred.

    enter image description here

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

Sidebar

Related Questions

Trying to understand Ruby a bit better, I ran into this code surfing the
Trying to understand the math of this code snippet. A token is provided which
just trying to understand this code. $db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE);
Trying to understand this MSDN sample but I'm confused about these lines: IAsyncResult result
Trying to understand PNG format. Consider this PNG Image: The Image is taken from
Im trying to understand how class generics work and this bit just doesnt make
Trying to understand, how to redirect program output to a file... Code : import
Trying to understand how CoffeeScript instance and class variable works I came with this
Trying to understand this open source app on github, it has a gem file:
Trying to understand how the code below always brings up a number between 0-6

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.