title: Heap growth after returning to baseline state
body: <p>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?</p>
  
  <pre><code>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;
  </code></pre>