8078654: CloseTTFontFileFunc callback should be removed
authoradinn
Wed, 29 Apr 2015 16:02:57 -0700
changeset 30494 a245f4430b4c
parent 30493 5b6e20b095f3
child 30495 ab8287b4c789
8078654: CloseTTFontFileFunc callback should be removed Reviewed-by: prr, martin
jdk/src/java.desktop/share/native/libfontmanager/freetypeScaler.c
--- a/jdk/src/java.desktop/share/native/libfontmanager/freetypeScaler.c	Wed Apr 29 12:57:24 2015 -0700
+++ b/jdk/src/java.desktop/share/native/libfontmanager/freetypeScaler.c	Wed Apr 29 16:02:57 2015 -0700
@@ -147,20 +147,6 @@
 
 #define FILEDATACACHESIZE 1024
 
-/* NB: is it ever called? */
-static void CloseTTFontFileFunc(FT_Stream stream) {
-    FTScalerInfo *scalerInfo = (FTScalerInfo *) stream->pathname.pointer;
-    JNIEnv* env = scalerInfo->env;
-    jclass tmpClass = (*env)->FindClass(env, "sun/font/TrueTypeFont");
-    jfieldID platNameField =
-         (*env)->GetFieldID(env, tmpClass, "platName", "Ljava/lang/String;");
-    jstring platName = (*env)->GetObjectField(env,
-                                              scalerInfo->font2D,
-                                              platNameField);
-    const char *name = JNU_GetStringPlatformChars(env, platName, NULL);
-    JNU_ReleaseStringPlatformChars(env, platName, name);
-}
-
 static unsigned long ReadTTFontFileFunc(FT_Stream stream,
                                         unsigned long offset,
                                         unsigned char* destBuffer,
@@ -305,7 +291,7 @@
                     ftstream->size = filesize;
                     ftstream->pos = 0;
                     ftstream->read = (FT_Stream_IoFunc) ReadTTFontFileFunc;
-                    ftstream->close = (FT_Stream_CloseFunc) CloseTTFontFileFunc;
+                    ftstream->close = NULL;
                     ftstream->pathname.pointer = (void *) scalerInfo;
 
                     memset(&ft_open_args, 0, sizeof(FT_Open_Args));