Jump to content
  • Advertisement
Sign in to follow this  
ms75214

mac warning

This topic is 2662 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Here's some mac code I have.


BOOL loadGLTextures()
{
BOOL status = FALSE;


NSString* filename = [NSString stringWithFormat:@"%@/%s",
[ [ NSBundle mainBundle ] resourcePath ],
"thefont2.bmp" ];


When I step over the last line, i get this warning in the console:

2011-03-07 10:29:18.461 reversi2[250:903] *** __NSAutoreleaseNoPool(): Object 0x31c9f0 of class NSCFString autoreleased with no pool in place - just leaking
2011-03-07 10:29:18.472 reversi2[250:903] *** __NSAutoreleaseNoPool(): Object 0x114fc0 of class NSCFString autoreleased with no pool in place - just leaking


Anyone know what the deal is with this?



Share this post


Link to post
Share on other sites
Advertisement
Spend some time reading the fine manual about memory management and objective-C. It will save you a lot of bother!

In practice, you just need to create an autorelease pool somewhere (for a console app, usually main()):

NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

/* ... code ... */

[pool drain];

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!