mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-10-01 21:09:35 +02:00
cocoa: memory management - removing unneeded autorelease pools. There's one global and one per each event
git-svn-id: trunk@59231 -
This commit is contained in:
parent
a1b87dac3d
commit
9b98baa793
@ -1349,13 +1349,11 @@ var
|
||||
window, windowbelowpoint: NSWindow;
|
||||
p:NSPoint;
|
||||
winnr:NSInteger;
|
||||
pool:NSAutoReleasePool;
|
||||
begin
|
||||
Result := 0;
|
||||
if not assigned(NSApp) then
|
||||
Exit;
|
||||
|
||||
pool := NSAutoreleasePool.alloc.init;
|
||||
windows := NSApp.windows;
|
||||
for win := 0 to windows.count - 1 do
|
||||
begin
|
||||
@ -1369,12 +1367,10 @@ begin
|
||||
Result:=RecurseSubviews(window.contentView, Point);
|
||||
if Result<>0 then
|
||||
begin
|
||||
pool.release;
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
pool.release;
|
||||
end;
|
||||
|
||||
|
||||
@ -2315,12 +2311,10 @@ function TCocoaWidgetSet.SetForegroundWindow(HWnd: HWND): boolean;
|
||||
var
|
||||
Obj: NSObject;
|
||||
lWin: NSWindow;
|
||||
pool: NSAutoreleasePool;
|
||||
begin
|
||||
Result := HWnd <> 0;
|
||||
if Result then
|
||||
begin
|
||||
pool := NSAutoreleasePool.alloc.init;
|
||||
NSApp.activateIgnoringOtherApps(True);
|
||||
Obj := NSObject(HWnd);
|
||||
lWin := NSWindow(GetNSObjectWindow(Obj));
|
||||
@ -2328,7 +2322,6 @@ begin
|
||||
lWin.makeKeyAndOrderFront(NSApp)
|
||||
else
|
||||
Result := False;
|
||||
pool.release;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user