mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 13:39:30 +02:00
cocoa: making mainpool lazy initialization - moving to AppInit, to prevent conflicts with dynlib loading. bug #36360
git-svn-id: trunk@62352 -
This commit is contained in:
parent
79faff4c47
commit
62ef41f719
@ -673,6 +673,13 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
procedure InternalInit;
|
||||
begin
|
||||
// MacOSX 10.6 reports a lot of warnings during initialization process
|
||||
// adding the autorelease pool for the whole Cocoa widgetset
|
||||
MainPool := NSAutoreleasePool.alloc.init;
|
||||
end;
|
||||
|
||||
procedure InternalFinal;
|
||||
begin
|
||||
if Assigned(MainPool) then
|
||||
@ -689,13 +696,6 @@ end;
|
||||
// the implementation of the extra LCL interface methods
|
||||
{$I cocoalclintf.inc}
|
||||
|
||||
procedure InternalInit;
|
||||
begin
|
||||
// MacOSX 10.6 reports a lot of warnings during initialization process
|
||||
// adding the autorelease pool for the whole Cocoa widgetset
|
||||
MainPool := NSAutoreleasePool.alloc.init;
|
||||
end;
|
||||
|
||||
procedure TCocoaWidgetSet.DoSetMainMenu(AMenu: NSMenu; ALCLMenu: TMenu);
|
||||
var
|
||||
i: Integer;
|
||||
@ -850,7 +850,6 @@ end;
|
||||
|
||||
initialization
|
||||
// {$I Cocoaimages.lrs}
|
||||
InternalInit;
|
||||
|
||||
finalization
|
||||
InternalFinal;
|
||||
|
@ -31,6 +31,8 @@ begin
|
||||
{$IFDEF VerboseObject}
|
||||
DebugLn('TCocoaWidgetSet.AppInit');
|
||||
{$ENDIF}
|
||||
InternalInit;
|
||||
|
||||
WakeMainThread := @OnWakeMainThread;
|
||||
ScreenInfo.PixelsPerInchX := CocoaBasePPI;
|
||||
ScreenInfo.PixelsPerInchY := CocoaBasePPI;
|
||||
|
Loading…
Reference in New Issue
Block a user