diff --git a/lcl/interfaces/cocoa/cocoaint.pas b/lcl/interfaces/cocoa/cocoaint.pas index 1cc7421a56..781d275398 100644 --- a/lcl/interfaces/cocoa/cocoaint.pas +++ b/lcl/interfaces/cocoa/cocoaint.pas @@ -201,6 +201,9 @@ type procedure AppSetIcon(const Small, Big: HICON); override; procedure AppSetTitle(const ATitle: string); override; + function BeginMessageProcess: TLCLHandle; override; + procedure EndMessageProcess(context: TLCLHandle); override; + function GetLCLCapability(ACapability: TLCLCapability): PtrUInt; override; function CreateTimer(Interval: integer; TimerFunc: TWSTimerProc): TLCLHandle; override; diff --git a/lcl/interfaces/cocoa/cocoaobject.inc b/lcl/interfaces/cocoa/cocoaobject.inc index afa6e5b5d6..648736e550 100644 --- a/lcl/interfaces/cocoa/cocoaobject.inc +++ b/lcl/interfaces/cocoa/cocoaobject.inc @@ -124,6 +124,17 @@ begin AppRunMessages(true, NSDate.distantFuture); end; +function TCocoaWidgetSet.BeginMessageProcess: TLCLHandle; +begin + Result := TLCLHandle(NSAutoreleasePool.alloc.init); +end; + +procedure TCocoaWidgetSet.EndMessageProcess(context: TLCLHandle); +begin + NSAutoreleasePool(context).release; +end; + + {------------------------------------------------------------------------------ Method: TCocoaWidgetSet.Create