mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-24 23:40:45 +00:00
Fixed: Frozing after closing SWF file caused by incorrect freeing memory
This commit is contained in:
@@ -275,7 +275,7 @@ public class TagListTreeModel extends AbstractTagTreeModel {
|
||||
|
||||
for (SWF swf : toRemove) {
|
||||
swfHeaders.remove(swf);
|
||||
removeFromCache(swf);
|
||||
uncacheSwf(swf);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,13 +50,11 @@ public abstract class AbstractTagTreeModel implements TreeModel {
|
||||
|
||||
protected Map<TreeItem, TreeItem> itemToParentCache = new WeakHashMap<>();
|
||||
|
||||
protected void removeFromCache(TreeItem itemToRemove) {
|
||||
itemToParentCache.remove(itemToRemove);
|
||||
protected void uncacheSwf(SWF swf) {
|
||||
Set<TreeItem> tSet = new HashSet<>(itemToParentCache.keySet());
|
||||
for (TreeItem item : tSet) {
|
||||
TreeItem parent = itemToParentCache.get(item);
|
||||
if (parent == itemToRemove) {
|
||||
removeFromCache(item);
|
||||
if (item.getOpenable() == swf) {
|
||||
itemToParentCache.remove(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ public class TagTreeModel extends AbstractTagTreeModel {
|
||||
|
||||
for (SWF swf : toRemove) {
|
||||
swfInfos.remove(swf);
|
||||
removeFromCache(swf);
|
||||
uncacheSwf(swf);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user