(-initWithCoder:): Make sure the returned font has a correct retain count on all paths.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@17131 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Alexander Malmberg 2003-07-05 14:08:43 +00:00
parent d03c09f65b
commit a8236e46af
2 changed files with 9 additions and 4 deletions

View file

@ -1,3 +1,8 @@
2003-07-05 16:07 Alexander Malmberg <alexander@malmberg.org>
* Source/NSFont.m (-initWithCoder:): Make sure that the returned
font has a correct retain count on all paths.
2003-07-04 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSPasteboard.m: Add code to set protocols for proxy objects.

View file

@ -998,7 +998,7 @@ static BOOL flip_hack;
self = [NSFont userFontOfSize: fontMatrix[0]];
NSAssert(self != nil, @"Couldn't find a valid font when decoding.");
return self;
return RETAIN(self);
}
else
{
@ -1057,13 +1057,13 @@ static BOOL flip_hack;
break;
}
[self release];
RELEASE(self);
if (new)
return new;
return RETAIN(new);
new = [NSFont userFontOfSize: size];
NSAssert(new != nil, @"Couldn't find a valid font when decoding.");
return new;
return RETAIN(new);
}
}