mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 06:10:37 +00:00
* 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:
parent
b1a66b9002
commit
2800af404c
2 changed files with 17 additions and 1 deletions
|
@ -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"];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue