Some changes to reduce memory leaks.

This commit is contained in:
LevelX2 2014-01-31 15:08:40 +01:00
parent e2c0e211ef
commit 30ddcaf99b
12 changed files with 139 additions and 83 deletions

View file

@ -39,9 +39,11 @@ import mage.client.plugins.impl.Plugins;
import javax.swing.*;
import java.awt.*;
import java.beans.PropertyVetoException;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import mage.client.MageFrame;
/**
*
@ -73,9 +75,16 @@ public class DraftPane extends MagePane {
this.setTitle("Draft - " + draftId);
this.draftPanel1.showDraft(draftId);
}
public void hideDraft() {
draftPanel1.hideDraft();
public void hideDraft() {
KeyboardFocusManager.getCurrentKeyboardFocusManager().clearGlobalFocusOwner();
try {
this.setClosed(true);
} catch (PropertyVetoException ex) {
}
this.hideFrame();
MageFrame.getDesktop().remove(this);
}
/** This method is called from within the constructor to

View file

@ -64,7 +64,7 @@ public class DraftPanel extends javax.swing.JPanel {
private int timeout;
private boolean picked;
private static CardsView emptyView = new CardsView();
private static final CardsView emptyView = new CardsView();
/** Creates new form DraftPanel */
public DraftPanel() {
@ -162,7 +162,7 @@ public class DraftPanel extends javax.swing.JPanel {
c = c.getParent();
}
if (c != null) {
((DraftPane)c).hideFrame();
((DraftPane)c).hideDraft();
}
}