< prev index next >
src/java.desktop/unix/native/common/awt/fontpath.c
Print this page
*** 1135,1144 ****
--- 1135,1145 ----
while ((cnt < max) && (cacheDir = (*FcStrListNext)(cacheDirs))) {
jstr = (*env)->NewStringUTF(env, (const char*)cacheDir);
JNU_CHECK_EXCEPTION(env);
(*env)->SetObjectArrayElement(env, cacheDirArray, cnt++, jstr);
+ (*env)->DeleteLocalRef(env, jstr);
}
(*FcStrListDone)(cacheDirs);
}
}
*** 1161,1174 ****
--- 1162,1178 ----
fcCompFontObj = (*env)->GetObjectArrayElement(env, fcCompFontArray, i);
fcNameStr =
(jstring)((*env)->GetObjectField(env, fcCompFontObj, fcNameID));
fcName = (*env)->GetStringUTFChars(env, fcNameStr, 0);
if (fcName == NULL) {
+ (*env)->DeleteLocalRef(env, fcCompFontObj);
+ (*env)->DeleteLocalRef(env, fcNameStr);
continue;
}
pattern = (*FcNameParse)((FcChar8 *)fcName);
(*env)->ReleaseStringUTFChars(env, fcNameStr, (const char*)fcName);
+ (*env)->DeleteLocalRef(env, fcNameStr);
if (pattern == NULL) {
closeFontConfig(libfontconfig, JNI_FALSE);
return;
}
*** 1324,1359 ****
--- 1328,1373 ----
(*env)->NewObject(env, fcFontClass, fcFontCons);
if (IS_NULL(fcFont)) break;
jstr = (*env)->NewStringUTF(env, (const char*)family[j]);
if (IS_NULL(jstr)) break;
(*env)->SetObjectField(env, fcFont, familyNameID, jstr);
+ (*env)->DeleteLocalRef(env, jstr);
if (file[j] != NULL) {
jstr = (*env)->NewStringUTF(env, (const char*)file[j]);
if (IS_NULL(jstr)) break;
(*env)->SetObjectField(env, fcFont, fontFileID, jstr);
+ (*env)->DeleteLocalRef(env, jstr);
}
if (styleStr[j] != NULL) {
jstr = (*env)->NewStringUTF(env, (const char*)styleStr[j]);
if (IS_NULL(jstr)) break;
(*env)->SetObjectField(env, fcFont, styleNameID, jstr);
+ (*env)->DeleteLocalRef(env, jstr);
}
if (fullname[j] != NULL) {
jstr = (*env)->NewStringUTF(env, (const char*)fullname[j]);
if (IS_NULL(jstr)) break;
(*env)->SetObjectField(env, fcFont, fullNameID, jstr);
+ (*env)->DeleteLocalRef(env, jstr);
}
if (fn==0) {
(*env)->SetObjectField(env, fcCompFontObj,
fcFirstFontID, fcFont);
}
if (includeFallbacks) {
(*env)->SetObjectArrayElement(env, fcFontArr, fn++,fcFont);
} else {
+ (*env)->DeleteLocalRef(env, fcFont);
break;
}
+ (*env)->DeleteLocalRef(env, fcFont);
}
}
+ if (includeFallbacks) {
+ (*env)->DeleteLocalRef(env, fcFontArr);
+ }
+ (*env)->DeleteLocalRef(env, fcCompFontObj);
(*FcFontSetDestroy)(fontset);
(*FcPatternDestroy)(pattern);
free(family);
free(styleStr);
free(fullname);
< prev index next >