mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-01 08:24:53 +00:00
free mainpanel on reload (it is not disposed by java GC for some reason)
This commit is contained in:
@@ -141,6 +141,7 @@ import java.awt.BorderLayout;
|
||||
import java.awt.CardLayout;
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import java.awt.Container;
|
||||
import java.awt.Desktop;
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.Font;
|
||||
@@ -3208,4 +3209,21 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private void disposeInner(Container container) {
|
||||
for (Component c : container.getComponents()) {
|
||||
if (c instanceof Container) {
|
||||
Container c2 = (Container) c;
|
||||
disposeInner(c2);
|
||||
}
|
||||
}
|
||||
|
||||
container.removeAll();
|
||||
container.setLayout(null);
|
||||
Helper.emptyObject(container);
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
disposeInner(this);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user