src/macosx/classes/sun/font/CStrike.java

Print this page

        

@@ -498,11 +498,14 @@
             // clean up everyone else
             if (generalCache != null) {
                 final Iterator<Long> i = generalCache.values().iterator();
                 while (i.hasNext()) {
                     final long longValue = i.next().longValue();
-                    if (longValue != -1 && longValue != 0) StrikeCache.freeLongPointer(longValue);
+                    if (longValue != -1 && longValue != 0) {
+                        removeGlyphInfoFromCache(longValue);
+                        StrikeCache.freeLongPointer(longValue);
+                    }
                 }
             }
 
             // rdar://problem/5204197
             // Finally, set the flag.

@@ -510,11 +513,14 @@
         }
 
         private static void disposeLongArray(final long[] longArray) {
             for (int i = 0; i < longArray.length; i++) {
                 final long ptr = longArray[i];
-                if (ptr != 0 && ptr != -1) StrikeCache.freeLongPointer(ptr); // free's the native struct pointer
+                if (ptr != 0 && ptr != -1) {
+                    removeGlyphInfoFromCache(ptr);
+                    StrikeCache.freeLongPointer(ptr); // free's the native struct pointer
+                }
             }
         }
 
         private static class SparseBitShiftingTwoLayerArray {
             final long[][] cache;