Leak in NSFont (10.2) or am I missing something?
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.