mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
Ensure animation card panels are disposed
This commit is contained in:
@@ -142,8 +142,8 @@ public class CHand implements ICDoc {
|
||||
endX = toPos.x;
|
||||
endY = toPos.y;
|
||||
|
||||
final CardPanel animationPanel = new CardPanel(placeholder.getGameCard());
|
||||
if (Singletons.getView().getFrame().isShowing()) {
|
||||
final CardPanel animationPanel = new CardPanel(placeholder.getGameCard());
|
||||
Animation.moveCard(startX, startY, startWidth, endX, endY, endWidth, animationPanel, placeholder,
|
||||
layeredPane, 500);
|
||||
}
|
||||
|
||||
@@ -225,7 +225,6 @@ public class CardPanel extends JPanel implements CardContainer, IDisposable {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Setter for the field <code>displayEnabled</code>.
|
||||
|
||||
@@ -27,6 +27,7 @@ import java.util.TimerTask;
|
||||
import javax.swing.JLayeredPane;
|
||||
import javax.swing.SwingUtilities;
|
||||
|
||||
import forge.gui.toolbox.FSkin;
|
||||
import forge.view.arcane.CardPanel;
|
||||
|
||||
|
||||
@@ -392,6 +393,9 @@ public abstract class Animation {
|
||||
animationPanel.setVisible(false);
|
||||
animationPanel.repaint();
|
||||
layeredPane.remove(animationPanel);
|
||||
if (animationPanel != CardPanel.getDragAnimationPanel()) {
|
||||
FSkin.dispose(animationPanel);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user