8162097: [PIT] A series of closed tests about SunFontManager throw NPE on Windows

Reviewed-by: bpb, serb
This commit is contained in:
Phil Race 2016-07-25 15:09:23 -07:00
parent 799f4aec1e
commit 599b5149b5

View File

@ -305,8 +305,8 @@ static int CALLBACK EnumFamilyNamesW(
familyLC = (*env)->CallObjectMethod(env, fmi->family,
fmi->toLowerCaseMID, fmi->locale);
/* Delete the created reference after its usage */
DeleteLocalReference(env, fmi->family);
if ((*env)->ExceptionCheck(env)) {
DeleteLocalReference(env, fmi->family);
return 0;
}
@ -317,10 +317,12 @@ static int CALLBACK EnumFamilyNamesW(
familyLC);
if ((*env)->ExceptionCheck(env)) {
/* Delete the created references before return */
DeleteLocalReference(env, fmi->family);
DeleteLocalReference(env, familyLC);
return 0;
} else if (mapHasKey) {
/* Delete the created references before return */
DeleteLocalReference(env, fmi->family);
DeleteLocalReference(env, familyLC);
return 1;
}
@ -329,6 +331,7 @@ static int CALLBACK EnumFamilyNamesW(
fmi->arrayListClass, fmi->arrayListCtr, 4);
if (fmi->list == NULL) {
/* Delete the created references before return */
DeleteLocalReference(env, fmi->family);
DeleteLocalReference(env, familyLC);
return 0;
}
@ -339,6 +342,7 @@ static int CALLBACK EnumFamilyNamesW(
DeleteLocalReference(env, familyLC);
if ((*env)->ExceptionCheck(env)) {
/* Delete the created reference before return */
DeleteLocalReference(env, fmi->family);
DeleteLocalReference(env, fmi->list);
return 0;
}
@ -351,6 +355,7 @@ static int CALLBACK EnumFamilyNamesW(
lParam, 0L);
/* Delete the created reference after its usage in the enum function */
DeleteLocalReference(env, fmi->family);
DeleteLocalReference(env, fmi->list);
return 1;
}