- Catch exceptions when disposing ImageCache textures, otherwise certain modes crash (e.g. Quest Draft Tournaments)

This commit is contained in:
Agetian
2020-06-29 21:12:34 +03:00
parent 5f7acbad2f
commit d1a63442c2

View File

@@ -405,7 +405,14 @@ public class Forge implements ApplicationListener {
try {
endKeyInput(); //end key input before switching screens
ForgeAnimation.endAll(); //end all active animations before switching screens
ImageCache.disposeTexture();
try {
ImageCache.disposeTexture();
}
catch (Exception ex)
{
// FIXME: This isn't supposed to be necessary, but disposeTexture crashes e.g. in Quest Tournaments on mobile, needs proper fixing.
System.err.println("Warning: caught an exception while trying to call ImageCache.disposeTexture() in setCurrentScreen.");
}
currentScreen = screen0;
currentScreen.setSize(screenWidth, screenHeight);