* Changes to clear of card panel on panel remove.

This commit is contained in:
LevelX2 2014-02-05 16:58:19 +01:00
parent e9dc1a1c68
commit 6fe430ecba
2 changed files with 3 additions and 2 deletions

View file

@ -229,7 +229,7 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener,
// remove possible mouse listeners, preventing gc // remove possible mouse listeners, preventing gc
for (MageCard mageCard: cards.values()) { for (MageCard mageCard: cards.values()) {
if (mageCard instanceof CardPanel) { if (mageCard instanceof CardPanel) {
((CardPanel)mageCard).clear(); ((CardPanel)mageCard).cleanUp();
} }
} }
this.cards.clear(); this.cards.clear();

View file

@ -252,7 +252,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
}); });
} }
public void clear() { public void cleanUp() {
if (dayNightButton != null) { if (dayNightButton != null) {
for(ActionListener al: dayNightButton.getActionListeners()) { for(ActionListener al: dayNightButton.getActionListeners()) {
dayNightButton.removeActionListener(al); dayNightButton.removeActionListener(al);
@ -267,6 +267,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
for(MouseWheelListener ml: this.getMouseWheelListeners() ){ for(MouseWheelListener ml: this.getMouseWheelListeners() ){
this.removeMouseWheelListener(ml); this.removeMouseWheelListener(ml);
} }
this.callback = null;
} }
private void setText(CardView card) { private void setText(CardView card) {