* NSMenuItem.m in copyWithZone: fixed bug which crashed menus two or more

deep when said menus are opened and detached twice


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@2955 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
far 1998-09-03 15:00:37 +00:00
parent 649eea0083
commit 6bbde41d9c
2 changed files with 9 additions and 4 deletions

View file

@ -84,10 +84,10 @@ static BOOL usesUserKeyEquivalents = YES;
NSDebugLog (@"menu item '%@' copy", [self title]);
copy->representedObject = [representedObject retain];
copy->hasSubmenu = hasSubmenu;
if (hasSubmenu) {
id submenu = [[target copyWithZone:zone] autorelease];
copy->target = [submenu retain];
}
if (hasSubmenu) { // recursive call
id submenu = [target copyWithZone:zone]; // to create our
copy->target = [submenu retain]; // submenus
}
return copy;
}