mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 01:29:08 +02:00
cocoa: menus - fix cocoa app mem leak for allocated TcocoaMenuItems
git-svn-id: trunk@59754 -
This commit is contained in:
parent
480574f3d9
commit
360bfc74b1
@ -588,10 +588,12 @@ begin
|
||||
if Assigned(menuitem.menu) then
|
||||
menuitem.menu.removeItem(menuitem);
|
||||
AMenuItem.Handle := 0;
|
||||
menuitem.release; // TCocoaMenuItems are "alloced" - thus should be released;
|
||||
end else if item.isKindOfClass_(NSMenuItem) then begin
|
||||
nsitem := NSMenuItem(item);
|
||||
if nsitem.isSeparatorItem and Assigned(nsitem.menu) then
|
||||
nsitem.menu.removeItem(nsitem);
|
||||
// separator items are not "alloced", thus should not be released
|
||||
end;
|
||||
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user