• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Does cocoa just leak?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Does cocoa just leak?
      • From: Fabrice Truillot <email@hidden>
  • Prev by Date: Re: Does cocoa just leak?
  • Next by Date: Re: Does cocoa just leak?
  • Previous by thread: Re: Does cocoa just leak?
  • Next by thread: Re: Does cocoa just leak?
  • Index(es):
    • Date
    • Thread