提交 e43ae97d 编写于 作者: P prr

8031095: [Parfait] warning from jdk/src/solaris/native/sun/awt: memory leak

Reviewed-by: bae, jgodinez
上级 afb86fb1
...@@ -540,6 +540,19 @@ awtJNI_GetFontData(JNIEnv * env, jobject font, char **errmsg) ...@@ -540,6 +540,19 @@ awtJNI_GetFontData(JNIEnv * env, jobject font, char **errmsg)
fdata->xfont = fdata->flist[i].xfont; fdata->xfont = fdata->flist[i].xfont;
fdata->flist[i].index_length = 1; fdata->flist[i].index_length = 1;
} else { } else {
/* Free any already allocated storage and fonts */
int j = i;
for (j = 0; j <= i; j++) {
free((void *)fdata->flist[j].xlfd);
JNU_ReleaseStringPlatformChars(env, NULL,
fdata->flist[j].charset_name);
if (fdata->flist[j].load) {
XFreeFont(awt_display, fdata->flist[j].xfont);
}
}
free((void *)fdata->flist);
free((void *)fdata);
if (errmsg != NULL) { if (errmsg != NULL) {
*errmsg = "java/lang" "NullPointerException"; *errmsg = "java/lang" "NullPointerException";
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册