[Lazarus] Modal Window Crashes on Mac OS X 10.15 Beta (Catalina)

Tobias Giesen tobiasgiesen at gmail.com
Tue Jun 11 16:30:15 CEST 2019

I will try it in a few hours 


Please excuse the shortness of this mail which was sent from my mobile phone. If necessary, I will send more information later.

Tobias Giesen

> Am 11.06.2019 um 16:19 schrieb Dmitry Boyarintsev via lazarus <lazarus at lists.lazarus-ide.org>:
>> On Tue, Jun 11, 2019 at 10:06 AM David Jenkins via lazarus <lazarus at lists.lazarus-ide.org> wrote:
>> I looked at the assembly for NSApplication.run, there are a lot of things being called and set before the call to nextEventMatching...   The .isRunning variable being one of them - which is read only and can't be set.  It can be overridden (and is one of the suggested overrides) but unfortunately there are times, in other parts of the code, that they look directly at the ._running variable where the value of .isRunning is stored instead of calling .isRunning (look at NSApplication._setMainWindow).  Which sets up a mismatch between what an overridden .isRunning method would return and what ._running is set to.
> Let's back-up a little bit.
> Can we actually try to set the value for the instance variable?
> 1) it's absolutely legal in Objective-C terms (object_getInstanceVariable, object_setInstanceVariable).
> 2) its' absolutely legal in KVC term. (I can presume that KVC is pretty much based on top of objc-run time. And this is how the entire Swift<->ObjC binding works)
> Can anyone try and modify TCocoaApplication.run to look like this. (If you're using trunk, you'll need to have {$define COCOALOOPOVERRIDE} defines in cocoadefines.inc}
> procedure TCocoaApplication.run;
> begin
>   self.setValue_forKey(NSNumber.numberWithBool(true),NSSTR('_running')); // setting instance variable through KVC
>   isrun:=true;
>   aloop();
> end;  
> -- 
> _______________________________________________
> lazarus mailing list
> lazarus at lists.lazarus-ide.org
> https://lists.lazarus-ide.org/listinfo/lazarus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20190611/842f1ab0/attachment.html>

More information about the lazarus mailing list