diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java index 85c168a5f..a8b8555bc 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java @@ -2497,6 +2497,12 @@ public final class SWF implements SWFContainerItem, Timelined { } } + public static void clearAllStaticCache() { + Cache.clearAll(); + Helper.clearShapeCache(); + System.gc(); + } + public void clearAllCache() { characters = null; characterIdTags = null; @@ -2505,9 +2511,7 @@ public final class SWF implements SWFContainerItem, Timelined { clearReadOnlyListCache(); clearImageCache(); clearScriptCache(); - Cache.clearAll(); - Helper.clearShapeCache(); - System.gc(); + clearAllStaticCache(); } public static void uncache(ASMSource src) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/helpers/Helper.java b/libsrc/ffdec_lib/src/com/jpexs/helpers/Helper.java index 27c8f46f9..0b670ce61 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/helpers/Helper.java +++ b/libsrc/ffdec_lib/src/com/jpexs/helpers/Helper.java @@ -73,7 +73,7 @@ public class Helper { public static String decompilationErrorAdd = null; - private static final Map shapeCache = new HashMap<>(); + private static final Map shapeCache = new HashMap<>(); private static final String[] hexStringCache; @@ -1180,9 +1180,8 @@ public class Helper { } } - String key = byteArrayToBase64String(bs.toByteArray()); - if (shapeCache.containsKey(key)) { - return shapeCache.get(key); + if (shapeCache.containsKey(bs)) { + return shapeCache.get(bs); } for (int x = 0; x < width; x++) { @@ -1210,7 +1209,7 @@ public class Helper { } } - shapeCache.put(key, area); + shapeCache.put(bs, area); return area; } @@ -1238,9 +1237,8 @@ public class Helper { } } - String key = byteArrayToBase64String(bs.toByteArray()); - if (shapeCache.containsKey(key)) { - return shapeCache.get(key); + if (shapeCache.containsKey(bs)) { + return shapeCache.get(bs); } BitSet bsArea = new BitSet(width * height); @@ -1321,7 +1319,7 @@ public class Helper { } } - shapeCache.put(key, area); + shapeCache.put(bs, area); return area; }