提交 00afa9c0 编写于 作者: A azvegint

8064698: [parfait] JNI exception pending in jdk/src/java/desktop/unix/native:...

8064698: [parfait] JNI exception pending in jdk/src/java/desktop/unix/native: libawt_xawt/awt/, common/awt
Reviewed-by: alexsch, serb
上级 15c7d565
...@@ -42,7 +42,7 @@ struct EventIDs eventIDs; ...@@ -42,7 +42,7 @@ struct EventIDs eventIDs;
JNIEXPORT void JNICALL JNIEXPORT void JNICALL
Java_java_awt_Event_initIDs(JNIEnv *env, jclass cls) Java_java_awt_Event_initIDs(JNIEnv *env, jclass cls)
{ {
eventIDs.data = (*env)->GetFieldID(env, cls, "data", "J"); CHECK_NULL(eventIDs.data = (*env)->GetFieldID(env, cls, "data", "J"));
eventIDs.consumed = (*env)->GetFieldID(env, cls, "consumed", "Z"); CHECK_NULL(eventIDs.consumed = (*env)->GetFieldID(env, cls, "consumed", "Z"));
eventIDs.id = (*env)->GetFieldID(env, cls, "id", "I"); CHECK_NULL(eventIDs.id = (*env)->GetFieldID(env, cls, "id", "I"));
} }
...@@ -579,6 +579,7 @@ awtJNI_GetFontData(JNIEnv * env, jobject font, char **errmsg) ...@@ -579,6 +579,7 @@ awtJNI_GetFontData(JNIEnv * env, jobject font, char **errmsg)
Disposer_AddRecord(env, font, pDataDisposeMethod, ptr_to_jlong(fdata)); Disposer_AddRecord(env, font, pDataDisposeMethod, ptr_to_jlong(fdata));
return fdata; return fdata;
} else { } else {
JNU_CHECK_EXCEPTION_RETURN(env, NULL);
Display *display = NULL; Display *display = NULL;
struct FontData *fdata = NULL; struct FontData *fdata = NULL;
char fontSpec[1024]; char fontSpec[1024];
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
* questions. * questions.
*/ */
#include "jni_util.h"
#include "awt_p.h" #include "awt_p.h"
#include "awt.h" #include "awt.h"
#include "color.h" #include "color.h"
...@@ -763,6 +764,7 @@ awt_init_Display(JNIEnv *env, jobject this) ...@@ -763,6 +764,7 @@ awt_init_Display(JNIEnv *env, jobject this)
XSetIOErrorHandler(xioerror_handler); XSetIOErrorHandler(xioerror_handler);
JNU_CallStaticMethodByName(env, NULL, "sun/awt/X11/XErrorHandlerUtil", "init", "(J)V", JNU_CallStaticMethodByName(env, NULL, "sun/awt/X11/XErrorHandlerUtil", "init", "(J)V",
ptr_to_jlong(awt_display)); ptr_to_jlong(awt_display));
JNU_CHECK_EXCEPTION_RETURN(env, NULL);
/* set awt_numScreens, and whether or not we're using Xinerama */ /* set awt_numScreens, and whether or not we're using Xinerama */
xineramaInit(); xineramaInit();
...@@ -789,6 +791,7 @@ awt_init_Display(JNIEnv *env, jobject this) ...@@ -789,6 +791,7 @@ awt_init_Display(JNIEnv *env, jobject this)
x11Screens[i].root = RootWindow(awt_display, i); x11Screens[i].root = RootWindow(awt_display, i);
} }
x11Screens[i].defaultConfig = makeDefaultConfig(env, i); x11Screens[i].defaultConfig = makeDefaultConfig(env, i);
JNU_CHECK_EXCEPTION_RETURN(env, NULL);
} }
return dpy; return dpy;
......
...@@ -72,6 +72,11 @@ static gboolean filenameFilterCallback(const GtkFileFilterInfo * filter_info, gp ...@@ -72,6 +72,11 @@ static gboolean filenameFilterCallback(const GtkFileFilterInfo * filter_info, gp
static void quit(JNIEnv * env, jobject jpeer, gboolean isSignalHandler) static void quit(JNIEnv * env, jobject jpeer, gboolean isSignalHandler)
{ {
jthrowable pendingException;
if (pendingException = (*env)->ExceptionOccurred(env)) {
(*env)->ExceptionClear(env);
}
GtkWidget * dialog = (GtkWidget*)jlong_to_ptr( GtkWidget * dialog = (GtkWidget*)jlong_to_ptr(
(*env)->GetLongField(env, jpeer, widgetFieldID)); (*env)->GetLongField(env, jpeer, widgetFieldID));
...@@ -95,6 +100,10 @@ static void quit(JNIEnv * env, jobject jpeer, gboolean isSignalHandler) ...@@ -95,6 +100,10 @@ static void quit(JNIEnv * env, jobject jpeer, gboolean isSignalHandler)
fp_gdk_threads_leave(); fp_gdk_threads_leave();
} }
} }
if (pendingException) {
(*env)->Throw(env, pendingException);
}
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册