Performance: fixed memory leaks on each card viewer or draft open (10 Mb per call, related to #11285, fixes #9548)

This commit is contained in:
Oleg Agafonov 2023-10-14 12:38:32 +04:00
parent ce311fd691
commit 36ccfb0a2a
13 changed files with 44 additions and 10 deletions

View file

@ -167,6 +167,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
MageFrame.getPreferences().put(KEY_DECK_EDITOR_SEARCH_RULES, Boolean.toString(chkRules.isSelected()));
MageFrame.getPreferences().put(KEY_DECK_EDITOR_SEARCH_TYPES, Boolean.toString(chkTypes.isSelected()));
MageFrame.getPreferences().put(KEY_DECK_EDITOR_SEARCH_UNIQUE, Boolean.toString(chkUnique.isSelected()));
ExpansionRepository.instance.unsubscribe(setsDbListener);
}
public void changeGUISize() {

View file

@ -40,6 +40,7 @@ public final class CollectionViewerPanel extends JPanel {
public void cleanUp() {
this.hidePopup();
this.bigCard = null;
ExpansionRepository.instance.unsubscribe(setsDbListener);
}
private void reloadFormatCombobox() {
@ -220,7 +221,6 @@ public final class CollectionViewerPanel extends JPanel {
if (c != null) {
((CollectionViewerPane) c).removeFrame();
}
}
private final class MageBookContainer extends JPanel {