Re: Hard calculation crashes after 60Minutes
Re: Hard calculation crashes after 60Minutes
- Subject: Re: Hard calculation crashes after 60Minutes
- From: Nathan Vander Wilt <email@hidden>
- Date: Sun, 31 Aug 2008 00:08:35 -0700
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:
This email sent to email@hidden