diff --git a/CHANGELOG.md b/CHANGELOG.md index 36499da84..234f3fef1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file. - [#1941] Export when no node is selected after SWF opening - Exception handling in cache clearing thread - DottedChain.PathPart NoSerializable exception +- [#1951] Clearing Namespace/Multiname cache after renaming identifiers ## [18.3.3] - 2023-01-22 ### Added @@ -2913,9 +2914,10 @@ All notable changes to this project will be documented in this file. [alpha 9]: https://github.com/jindrapetrik/jpexs-decompiler/compare/alpha8...alpha9 [alpha 8]: https://github.com/jindrapetrik/jpexs-decompiler/compare/alpha7...alpha8 [alpha 7]: https://github.com/jindrapetrik/jpexs-decompiler/releases/tag/alpha7 +[#1029]: https://www.free-decompiler.com/flash/issues/1029 [#1948]: https://www.free-decompiler.com/flash/issues/1948 [#1941]: https://www.free-decompiler.com/flash/issues/1941 -[#1029]: https://www.free-decompiler.com/flash/issues/1029 +[#1951]: https://www.free-decompiler.com/flash/issues/1951 [#1913]: https://www.free-decompiler.com/flash/issues/1913 [#1888]: https://www.free-decompiler.com/flash/issues/1888 [#1894]: https://www.free-decompiler.com/flash/issues/1894 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 21318c5da..68b65603e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java @@ -2695,12 +2695,16 @@ public final class SWF implements SWFContainerItem, Timelined, Openable { for (Tag tag : getTags()) { if (tag instanceof ABCContainerTag) { ((ABCContainerTag) tag).getABC().deobfuscateIdentifiers(deobfuscated, renameType, true); + ((ABCContainerTag) tag).getABC().constants.clearCachedMultinames(); + ((ABCContainerTag) tag).getABC().constants.clearCachedDottedChains(); tag.setModified(true); } } for (Tag tag : getTags()) { if (tag instanceof ABCContainerTag) { ((ABCContainerTag) tag).getABC().deobfuscateIdentifiers(deobfuscated, renameType, false); + ((ABCContainerTag) tag).getABC().constants.clearCachedMultinames(); + ((ABCContainerTag) tag).getABC().constants.clearCachedDottedChains(); tag.setModified(true); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2ConstantPool.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2ConstantPool.java index 48d3eef55..f90a6623b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2ConstantPool.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2ConstantPool.java @@ -101,6 +101,14 @@ public class AVM2ConstantPool implements Cloneable { multinameWithNamespaceCache.put(multiName, multinameWithNamespace); } + public void clearCachedMultinames() { + multinameWithNamespaceCache.clear(); + } + + public void clearCachedDottedChains() { + dottedChainCache.clear(); + } + private void ensureDefault(List list) { if (list.isEmpty()) { list.add(null);