Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hard calculation crashes after 60Minutes



On Aug 30, 2008, at 8:08 PM, Mr. Gecko wrote:
Hello I am making a program that does a really hard calculation and it seems to crash after 60 Minutes. I don't really know why it does, I am guessing it is because I am using a for loop that takes awhile to run

If you can't find any leaks, it may be that autoreleased objects are not really "leaking", but your code does not give the framework- supplied autorelease pool a chance to release the objects it owns. You should create a pool of your own around the top and bottom of your loop's block:


for (long_time) {
	NSAutoreleasePool* myPool = [NSAutoreleasePool new];
	// do stuff....
	[myPool release];		// or you could use [myPool drain] if on 10.4+
}


hope this helps, -natevw _______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Hard calculation crashes after 60Minutes (From: "Mr. Gecko" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.