mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-28 10:02:14 +00:00
UPD: optimize memory release in ContextMenu on macOS
This commit is contained in:
parent
95be3520aa
commit
cbb4b2fa5b
2 changed files with 12 additions and 8 deletions
|
|
@ -844,6 +844,8 @@ begin
|
|||
|
||||
cocoaItem:= NSMenuItem( lclMenu.Items[menuIndex].Handle );
|
||||
cocoaItem.setView( menuView );
|
||||
|
||||
menuView.release;
|
||||
end;
|
||||
|
||||
class procedure uDarwinFinderUtil.drawTagName( const tagName: NSString;
|
||||
|
|
|
|||
|
|
@ -767,14 +767,16 @@ begin
|
|||
end;
|
||||
|
||||
filepath:= Files[0].FullPath;
|
||||
|
||||
// Free previous created menu
|
||||
FreeAndNil(ShellContextMenu);
|
||||
// Create new context menu
|
||||
ShellContextMenu:= TShellContextMenu.Create(nil, Files, Background, UserWishForContextMenu);
|
||||
ShellContextMenu.OnClose := CloseEvent;
|
||||
// Show context menu
|
||||
MacosServiceMenuHelper.PopUp( ShellContextMenu, rsMacOSMenuServices, filepath );
|
||||
try
|
||||
// Create new context menu
|
||||
ShellContextMenu:= TShellContextMenu.Create(nil, Files, Background, UserWishForContextMenu);
|
||||
ShellContextMenu.OnClose := CloseEvent;
|
||||
// Show context menu
|
||||
MacosServiceMenuHelper.PopUp( ShellContextMenu, rsMacOSMenuServices, filepath );
|
||||
finally
|
||||
// Free created menu
|
||||
FreeAndNil(ShellContextMenu);
|
||||
end;
|
||||
end;
|
||||
{$ELSE}
|
||||
begin
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue