mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
Fixed Skeleton Viewer process staying alive after a crash.
This commit is contained in:
parent
ca70bd04e6
commit
88207a609c
@ -36,6 +36,7 @@ import static com.badlogic.gdx.scenes.scene2d.actions.Actions.*;
|
|||||||
import java.awt.FileDialog;
|
import java.awt.FileDialog;
|
||||||
import java.awt.Frame;
|
import java.awt.Frame;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.lang.Thread.UncaughtExceptionHandler;
|
||||||
|
|
||||||
import com.badlogic.gdx.ApplicationAdapter;
|
import com.badlogic.gdx.ApplicationAdapter;
|
||||||
import com.badlogic.gdx.Gdx;
|
import com.badlogic.gdx.Gdx;
|
||||||
@ -95,6 +96,13 @@ public class SkeletonViewer extends ApplicationAdapter {
|
|||||||
float lastModifiedCheck, reloadTimer;
|
float lastModifiedCheck, reloadTimer;
|
||||||
|
|
||||||
public void create () {
|
public void create () {
|
||||||
|
Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler() {
|
||||||
|
public void uncaughtException (Thread thread, Throwable ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
Runtime.getRuntime().halt(0); // Prevent Swing from keeping JVM alive.
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
ui = new UI();
|
ui = new UI();
|
||||||
batch = new PolygonSpriteBatch();
|
batch = new PolygonSpriteBatch();
|
||||||
renderer = new SkeletonMeshRenderer();
|
renderer = new SkeletonMeshRenderer();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user