mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
add dispose for GifAnimation
This commit is contained in:
@@ -1476,7 +1476,6 @@ public class FSkin {
|
|||||||
addEncodingSymbol("TK", FSkinProp.IMG_TICKET);
|
addEncodingSymbol("TK", FSkinProp.IMG_TICKET);
|
||||||
addEncodingSymbol("EXPERIENCE", FSkinProp.IMG_EXPERIENCE);
|
addEncodingSymbol("EXPERIENCE", FSkinProp.IMG_EXPERIENCE);
|
||||||
addEncodingSymbol("A-", FSkinProp.IMG_ALCHEMY);
|
addEncodingSymbol("A-", FSkinProp.IMG_ALCHEMY);
|
||||||
addEncodingSymbol("M", FSkinProp.ICO_MANASHARD);
|
|
||||||
|
|
||||||
// Set look and feel after skin loaded
|
// Set look and feel after skin loaded
|
||||||
FView.SINGLETON_INSTANCE.setSplashProgessBarMessage("Setting look and feel...");
|
FView.SINGLETON_INSTANCE.setSplashProgessBarMessage("Setting look and feel...");
|
||||||
|
|||||||
@@ -997,13 +997,14 @@ public class Forge implements ApplicationListener {
|
|||||||
currentScreen = null;
|
currentScreen = null;
|
||||||
}
|
}
|
||||||
FOverlay.hideAll();
|
FOverlay.hideAll();
|
||||||
assets.dispose();
|
|
||||||
Dscreens.clear();
|
Dscreens.clear();
|
||||||
graphics.dispose();
|
graphics.dispose();
|
||||||
SoundSystem.instance.dispose();
|
SoundSystem.instance.dispose();
|
||||||
try {
|
try {
|
||||||
ExceptionHandler.unregisterErrorHandling();
|
ExceptionHandler.unregisterErrorHandling();
|
||||||
lastPreview.dispose();
|
lastPreview.dispose();
|
||||||
|
assets.dispose();
|
||||||
|
AdventureScreen.dispose();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,4 +42,14 @@ public class GifAnimation extends ForgeAnimation {
|
|||||||
@Override
|
@Override
|
||||||
protected void onEnd(boolean endingAll) {
|
protected void onEnd(boolean endingAll) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void dispose() {
|
||||||
|
if (animation != null) {
|
||||||
|
for (TextureRegion tr: animation.getKeyFrames()) {
|
||||||
|
try {
|
||||||
|
tr.getTexture().dispose();
|
||||||
|
} catch (Exception e) {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -712,6 +712,7 @@ public class GifDecoder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Texture texture = new Texture(target);
|
Texture texture = new Texture(target);
|
||||||
|
target.dispose();
|
||||||
Array<TextureRegion> texReg = new Array<>();
|
Array<TextureRegion> texReg = new Array<>();
|
||||||
|
|
||||||
for(h = 0; h < hzones; h++) {
|
for(h = 0; h < hzones; h++) {
|
||||||
|
|||||||
@@ -64,4 +64,10 @@ public class AdventureScreen extends LaunchScreen {
|
|||||||
if (Gdx.files.absolute(demo).exists())
|
if (Gdx.files.absolute(demo).exists())
|
||||||
animation = new GifAnimation(demo, Animation.PlayMode.LOOP);
|
animation = new GifAnimation(demo, Animation.PlayMode.LOOP);
|
||||||
}
|
}
|
||||||
|
public static void dispose() {
|
||||||
|
if (animation != null) {
|
||||||
|
animation.dispose();
|
||||||
|
}
|
||||||
|
animation = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user