Removed majority of memory leaks from game / editor / dialog handling.

This commit is contained in:
LevelX2 2014-02-02 21:57:02 +01:00
parent 11df1dc059
commit 0a18a7bea6
24 changed files with 215 additions and 138 deletions

View file

@ -44,6 +44,8 @@ import javax.swing.border.Border;
import java.awt.*;
import java.util.*;
import java.util.Map.Entry;
import mage.cards.action.ActionCallback;
import mage.client.plugins.adapters.MageActionCallback;
import org.apache.log4j.Logger;
/**
@ -86,6 +88,13 @@ public class Cards extends javax.swing.JPanel {
}
}
public void cleanUp() {
ActionCallback actionCallback = Plugins.getInstance().getActionCallback();
if (actionCallback instanceof MageActionCallback) {
((MageActionCallback) actionCallback).setCardPreviewComponent(null);
}
}
/**
* Sets components background color
* @param color
@ -109,7 +118,7 @@ public class Cards extends javax.swing.JPanel {
}
}
public boolean loadCards(SimpleCardsView cardsView, BigCard bigCard, UUID gameId) {
public boolean loadCards(SimpleCardsView cardsView, BigCard bigCard, UUID gameId) {
return loadCards(CardsViewUtil.convertSimple(cardsView), bigCard, gameId, null);
}