• 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
Leak in NSFont (10.2) or am I missing something?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Leak in NSFont (10.2) or am I missing something?


  • Subject: Leak in NSFont (10.2) or am I missing something?
  • From: Charles Bennett <email@hidden>
  • Date: Mon, 26 Aug 2002 11:13:59 -0400

Hi all, I've boiled the sample down to this code.
Simply fire up the time with whatever time interval you want..

I then opened a terminal window and ran top.
RPRVT,RSIZE and VSIZE all just keep going up. To really see it, move the interval to .05 or something..

It's interesting, if I print the retainCount for font
right after I get it back from NSFont.. it is -1
does that make sense?

I'd expect 0 for an autoreleased font.

I'd guess that fontWithName:size: isn't seeing that it has
already returned a font with that name and size..

//Note for this leak test I don't do anything with font..
- (void) leaker {
NSFont *font = [NSFont fontWithName:@"Arial" size:12];
}


- (void) applicationDidFinishLaunching:(NSNotification*) notification {
leakTimer = [[NSTimer scheduledTimerWithTimerInterval:.25
target:self
selector:@selector(leaker)
userInfo:nil
repeats:TRUE] retain];
}



Chuck


--
UPS Management software for OS X
http://www.powerguardian.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >leek in componentsSeparatedByString (From: David Burris <email@hidden>)

  • Prev by Date: Re: leek in componentsSeparatedByString
  • Next by Date: No need for a workaround for offscreen graphics...
  • Previous by thread: leek in componentsSeparatedByString
  • Next by thread: Re: leek in componentsSeparatedByString
  • Index(es):
    • Date
    • Thread