Skip to content
Permalink
Browse files
8242544: CMD+ENTER key event crashes the application when invoked on …
…dialog

Backport-of: a2a0acff66727167bfca879bf908361433e74791
  • Loading branch information
kevinrushforth committed Feb 16, 2022
1 parent eec13f7 commit fdb50f2
Showing 1 changed file with 4 additions and 1 deletion.
@@ -989,7 +989,10 @@ static jlong _createWindowCommonDo(JNIEnv *env, jobject jWindow, jlong jOwnerPtr
}
else
{
[window->nsWindow performSelectorOnMainThread:@selector(setContentView:) withObject:nil waitUntilDone:YES];
// If the contentView is set to nil within performKeyEquivalent: the OS will crash.
NSView* dummy = [[NSView alloc] initWithFrame: NSMakeRect(0, 0, 10, 10)];
[window->nsWindow performSelectorOnMainThread:@selector(setContentView:) withObject:dummy waitUntilDone:YES];
[dummy release];
}
}
GLASS_POOL_EXIT;

1 comment on commit fdb50f2

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.