diff --git a/lcl/interfaces/cocoa/cocoawinapi.inc b/lcl/interfaces/cocoa/cocoawinapi.inc index 8048cfa6bd..eb6f715da6 100644 --- a/lcl/interfaces/cocoa/cocoawinapi.inc +++ b/lcl/interfaces/cocoa/cocoawinapi.inc @@ -1718,7 +1718,7 @@ begin ctx := CheckDC(DC); if not Assigned(ctx) then Exit; - if (ctx <> DefaultContext) and (ctx.ctx <> DefaultContext.ctx) then + if (ctx <> DefaultContext) and (ctx<>ScreenContext) then ctx.Free; Result := 1; end;