Fix error in caching.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14589 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2002-09-27 09:05:02 +00:00
parent a5b46e92b7
commit f73feaf4e9

View file

@ -489,16 +489,16 @@ setNSFont(NSString* key, NSFont* font)
fontMatrix[3], fontMatrix[4], fontMatrix[5]];
/* Check whether the font is cached */
font = (id)NSMapGet(globalFontMap, (void*)nameWithMatrix);
font = RETAIN((id)NSMapGet(globalFontMap, (void*)nameWithMatrix));
if (font == nil)
{
font = AUTORELEASE([[NSFontClass alloc] initWithName: aFontName
matrix: fontMatrix]);
font = [[NSFontClass alloc] initWithName: aFontName
matrix: fontMatrix];
/* Cache the font for later use */
NSMapInsert(globalFontMap, (void*)nameWithMatrix, (void*)font);
}
return font;
return AUTORELEASE(font);
}
/** Creates a new font with name aFontName and size fontSize. Fonts created