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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:08:46+00:00 2026-05-24T20:08:46+00:00

How do I avoid unneccesary deallocation? I’m running this code: CCSpriteFrameCache * cache =

  • 0

How do I avoid unneccesary deallocation? I’m running this code:

CCSpriteFrameCache * cache = [CCSpriteFrameCache sharedSpriteFrameCache];
    [cache addSpriteFramesWithFile:@"boosttexture.plist"];

    CCAnimation * animation = [[CCAnimation alloc] initWithName:@"boosting" delay:1/24.0f];

    [animation addFrame:[cache spriteFrameByName:@"ship.png"]];
    [animation addFrame:[cache spriteFrameByName:@"ship_boost_l_r.png"]];

    id action = [CCRepeatForever actionWithAction:[CCAnimate actionWithAnimation:animation]];
    [spaceShipSprite runAction:action];

When the animaton is running (granted – its an ugly one), I get this in the console:

2010-04-14 13:40:16.311 Booster2K10Beta[521:20b] cocos2d: deallocing CCSpriteFrame = 00EBA620 | TextureName=4, Rect = (1.00,32.00,32.00,32.00)

2010-04-14 13:40:16.411 Booster2K10Beta[521:20b] cocos2d: deallocing CCSpriteFrame = 00EBA620 | TextureName=4, Rect = (1.00,32.00,32.00,32.00)

2010-04-14 13:40:16.496 Booster2K10Beta[521:20b] cocos2d: deallocing CCSpriteFrame = 00EBA620 | TextureName=4, Rect = (1.00,32.00,32.00,32.00)

It seems unneccesary that the same SpriteFrame gets dealloc’ed 24 times per second – how do I avoid that?

  • 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-24T20:08:47+00:00Added an answer on May 24, 2026 at 8:08 pm

    I’m assuming you have CCDEBUG turned up to 2. Put it back down to 1. That’s CCLOGINFO stuff you’re seeing. Still, use Xcode’s profiling tools to see if memory is being drained away. I’m betting not. You’re just seeing things you don’t understand yet.

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

Sidebar

Related Questions

I'm trying to avoid code like this when reusing the same ViewUserControl in ASP.NET
Hello Functional C# Friends, So this time i am trying to compact my code
I'm writing cross-platform x86/x86-64/Itanium code oriented towards high performance and would like to avoid
Is it possible to avoid list property tags when serializing? //[Serializable()] - removed, unnecessary
How do I avoid read locks in my database? Answers for multiple databases welcome!
After trying to avoid JavaScript for years, Iv started using Query for validation in
Should developers avoid using continue in C# or its equivalent in other languages to
If I avoid referencing assemblies that don't exist in the silverlight 2.0 runtime, will
How can you avoid circular dependencies when you're designing two classes with a producer/consumer
I always try to avoid to return string literals, because I fear they aren't

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.