7191018: Manual test closed/java/awt/JAWT causes JVM to crash starting from JDK 5
Reviewed-by: anthony, serb
This commit is contained in:
parent
1aa32ce1d0
commit
78ee0b6ff2
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -346,13 +346,19 @@ JNIEXPORT jobject JNICALL
|
|||||||
awt_GetComponent(JNIEnv* env, void* platformInfo)
|
awt_GetComponent(JNIEnv* env, void* platformInfo)
|
||||||
{
|
{
|
||||||
Window window = (Window)platformInfo;
|
Window window = (Window)platformInfo;
|
||||||
Widget widget = NULL;
|
|
||||||
jobject peer = NULL;
|
jobject peer = NULL;
|
||||||
jobject target = NULL;
|
jobject target = NULL;
|
||||||
|
|
||||||
AWT_LOCK();
|
AWT_LOCK();
|
||||||
|
|
||||||
target = (*env)->GetObjectField(env, peer, targetID);
|
if (window != None) {
|
||||||
|
peer = JNU_CallStaticMethodByName(env, NULL, "sun/awt/X11/XToolkit",
|
||||||
|
"windowToXWindow", "(J)Lsun/awt/X11/XBaseWindow;", (jlong)window).l;
|
||||||
|
}
|
||||||
|
if ((peer != NULL) &&
|
||||||
|
(JNU_IsInstanceOfByName(env, peer, "sun/awt/X11/XWindow") == 1)) {
|
||||||
|
target = (*env)->GetObjectField(env, peer, targetID);
|
||||||
|
}
|
||||||
|
|
||||||
if (target == NULL) {
|
if (target == NULL) {
|
||||||
JNU_ThrowNullPointerException(env, "NullPointerException");
|
JNU_ThrowNullPointerException(env, "NullPointerException");
|
||||||
@ -360,7 +366,6 @@ JNIEXPORT jobject JNICALL
|
|||||||
return (jobject)NULL;
|
return (jobject)NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
AWT_UNLOCK();
|
AWT_UNLOCK();
|
||||||
|
|
||||||
return target;
|
return target;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user