exception on the vm should exit the app

This commit is contained in:
minjaesong
2023-01-03 01:52:38 +09:00
parent a066975ce6
commit ff23b13ba0
4 changed files with 29 additions and 8 deletions

View File

@@ -91,7 +91,13 @@ public class TsvmEmulator {
appConfig.setWindowedMode(WIDTH, HEIGHT);
new Lwjgl3Application(new VMEmuExecutableWrapper(VIEWPORT_W, VIEWPORT_H, PANELS_X, PANELS_Y,"assets/"), appConfig);
try {
new Lwjgl3Application(new VMEmuExecutableWrapper(VIEWPORT_W, VIEWPORT_H, PANELS_X, PANELS_Y, "assets/"), appConfig);
}
catch (Throwable e) {
e.printStackTrace();
if (Gdx.app != null) Gdx.app.exit();
}
}
private static void getDefaultDirectory() {

View File

@@ -194,7 +194,10 @@ class VMEmuExecutable(val windowWidth: Int, val windowHeight: Int, var panelsX:
internal fun initVMenv(vm: VM) {
val gpu = ReferenceGraphicsAdapter2("./assets", vm)
VMSetupBroker.initVMenv(vm, gpu, vmRunners, coroutineJobs)
VMSetupBroker.initVMenv(vm, gpu, vmRunners, coroutineJobs) {
it.printStackTrace()
VMSetupBroker.killVMenv(vm, vmRunners, coroutineJobs)
}
}
internal fun killVMenv(vm: VM) {