mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-22 13:19:28 +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;
|
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;
|
procedure InternalFinal;
|
||||||
begin
|
begin
|
||||||
if Assigned(MainPool) then
|
if Assigned(MainPool) then
|
||||||
@ -689,13 +696,6 @@ end;
|
|||||||
// the implementation of the extra LCL interface methods
|
// the implementation of the extra LCL interface methods
|
||||||
{$I cocoalclintf.inc}
|
{$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);
|
procedure TCocoaWidgetSet.DoSetMainMenu(AMenu: NSMenu; ALCLMenu: TMenu);
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
@ -850,7 +850,6 @@ end;
|
|||||||
|
|
||||||
initialization
|
initialization
|
||||||
// {$I Cocoaimages.lrs}
|
// {$I Cocoaimages.lrs}
|
||||||
InternalInit;
|
|
||||||
|
|
||||||
finalization
|
finalization
|
||||||
InternalFinal;
|
InternalFinal;
|
||||||
|
@ -31,6 +31,8 @@ begin
|
|||||||
{$IFDEF VerboseObject}
|
{$IFDEF VerboseObject}
|
||||||
DebugLn('TCocoaWidgetSet.AppInit');
|
DebugLn('TCocoaWidgetSet.AppInit');
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
InternalInit;
|
||||||
|
|
||||||
WakeMainThread := @OnWakeMainThread;
|
WakeMainThread := @OnWakeMainThread;
|
||||||
ScreenInfo.PixelsPerInchX := CocoaBasePPI;
|
ScreenInfo.PixelsPerInchX := CocoaBasePPI;
|
||||||
ScreenInfo.PixelsPerInchY := CocoaBasePPI;
|
ScreenInfo.PixelsPerInchY := CocoaBasePPI;
|
||||||
|
Loading…
Reference in New Issue
Block a user