Re: Does cocoa just leak?
Re: Does cocoa just leak?
- Subject: Re: Does cocoa just leak?
- From: Rosyna <email@hidden>
- Date: Sat, 29 Sep 2001 21:26:04 -0700
This does fix the leak in the loop, but not if people wish to use
convenience to [[NSFileManager defaultManager]
fileExistsAtPath:[[instance URL] path]]
That is still going to leak I believe.
And why isn't all the strings released when awakeFromNib is over when
an Auto release pool is not explicitly declared?
Ack, at 9/30/01, Fabrice Truillot said:
On Dimanche, septembre 30, 2001, at 05:37 , Rosyna wrote:
for (i=0;i<5000;i++)
[[instance URL] path];
You should take a look to NSAutoreleasePool.
Try something like that :
for (int i = 0; i < 100000; ++ i)
{
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
[[instance URL] path];
[pool release];
}
Or :
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
for (int i = 0; i < 100000; ++ i)
{
[[instance URL] path];
if (i % 100)
{
[pool release];
pool = [[NSAutoreleasePool alloc] init];
}
}
--
Sincerely,
Rosyna Keller
Technical Support/Holy Knight/Always needs a hug
Unsanity: Unsane Tools for Insane People