Don't reference ivar after the object has been freed.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28105 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2009-03-20 09:52:06 +00:00
parent d115384ecc
commit 1878af00d9
2 changed files with 16 additions and 8 deletions

View file

@ -8,6 +8,8 @@
expresions in condition to avoid possible access to uninitialized
memory.
* Source/NSScrollView.m (-initWithCoder:): Don't set _hasCornerView.
* Source/GSNibLoading.m (NSClassSwapper-initWithCoder:): Don't
reference freed memory.
2009-03-18 Richard Frith-Macdonald <rfm@gnu.org>

View file

@ -1411,10 +1411,10 @@ static BOOL _isInInterfaceBuilder = NO;
[_className isEqualToString: _originalClassName] == NO)
{
Class newCellClass = [newClass cellClass];
if(newCellClass != [NSCell class])
{
result = [[newCellClass alloc] initWithCoder: coder];
}
if (newCellClass != [NSCell class])
{
result = [[newCellClass alloc] initWithCoder: coder];
}
}
return result;
@ -1432,15 +1432,21 @@ static BOOL _isInInterfaceBuilder = NO;
// build the real object...
if ([NSClassSwapper isInInterfaceBuilder] == YES)
{
{
[self instantiateRealObject: coder withClassName: _originalClassName];
}
else
{
[self instantiateRealObject: coder withClassName: _className];
}
}
RELEASE(self);
{
id object;
object = RETAIN(_template);
RELEASE(self);
return AUTORELEASE(object);
}
}
else
{
@ -1449,7 +1455,7 @@ static BOOL _isInInterfaceBuilder = NO;
NSStringFromClass([coder class])];
}
return _template;
return self;
}
/**