提交 2a1d935b 编写于 作者: J jchen

8025480: [parfait] "JNI exception pending" warnings from b107 for jdk.src.share.native.sun.java2d

Reviewed-by: prr, jgodinez
上级 25a07433
......@@ -38,10 +38,9 @@ Java_sun_java2d_Disposer_initIDs(JNIEnv *env, jclass disposerClass)
{
addRecordMID = (*env)->GetStaticMethodID(env, disposerClass, "addRecord",
"(Ljava/lang/Object;JJ)V");
if (addRecordMID == 0) {
JNU_ThrowNoSuchMethodError(env, "Disposer.addRecord");
}
if (addRecordMID != 0) {
dispClass = (*env)->NewGlobalRef(env, disposerClass);
}
}
JNIEXPORT void JNICALL
......@@ -50,6 +49,10 @@ Disposer_AddRecord(JNIEnv *env, jobject obj, GeneralDisposeFunc disposer, jlong
if (dispClass == NULL) {
/* Needed to initialize the Disposer class as it may be not yet referenced */
jclass clazz = (*env)->FindClass(env, "sun/java2d/Disposer");
if ((*env)->ExceptionCheck(env)) {
// If there's exception pending, we'll just return.
return;
}
}
(*env)->CallStaticVoidMethod(env, dispClass, addRecordMID,
......
......@@ -237,8 +237,10 @@ SurfaceDataOps *SurfaceData_InitOps(JNIEnv *env, jobject sData, int opsSize)
SurfaceData_SetOps(env, sData, ops);
if (ops != NULL) {
memset(ops, 0, opsSize);
if (!(*env)->ExceptionCheck(env)) {
ops->sdObject = (*env)->NewWeakGlobalRef(env, sData);
}
}
return ops;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册