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

Reviewed-by: jpereda, kcr
  • Loading branch information
beldenfox authored and kevinrushforth committed Jan 12, 2022
1 parent 8c4f966 commit a2a0acf
Showing 1 changed file with 4 additions and 1 deletion.
@@ -843,7 +843,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 a2a0acf

@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.