On Wed, 12 Jan 2022 16:14:58 GMT, Jose Pereda <jper...@openjdk.org> wrote:

>> The OS crashes if the contentView of a window is set to nil while handling 
>> processKeyEquivalent. With this PR we just set the contentView to a basic 
>> do-nothing NSView for the interim.
>
> modules/javafx.graphics/src/main/native-glass/mac/GlassWindow.m line 848:
> 
>> 846:             // If the contentView is set to nil within 
>> performKeyEquivalent: the OS will crash.
>> 847:             NSView* dummy = [[NSView alloc] initWithFrame: 
>> NSMakeRect(0, 0, 10, 10)];
>> 848:             [window->nsWindow 
>> performSelectorOnMainThread:@selector(setContentView:) withObject:dummy 
>> waitUntilDone:YES];
> 
> I'm not sure is needed or worth it, but maybe the `dummy` view should be 
> released?

That's a good question.

-------------

PR: https://git.openjdk.java.net/jfx/pull/714

Reply via email to