* Source/NSMenuItem.m: Retain the GSMenuSeparator instance if

the menu item is a separator since we want to make sure the 
	object isn't prematurely released.  


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27611 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2009-01-16 16:56:44 +00:00
parent b1a66b9002
commit 2800af404c
2 changed files with 17 additions and 1 deletions

View file

@ -561,9 +561,19 @@ static Class imageClass;
if (isSeparator)
{
RELEASE(self);
return [NSMenuItem separatorItem];
//
// An object returned from initWithCoder:
// should not be autoreleased. Do a retain
// to prevent it from being released automatically.
//
return RETAIN([NSMenuItem separatorItem]);
}
//
// Not retained, because we're calling the designated init with
// the values.
//
title = [aDecoder decodeObjectForKey: @"NSTitle"];
action = [aDecoder decodeObjectForKey: @"NSAction"];
key = [aDecoder decodeObjectForKey: @"NSKeyEquiv"];