From a8d53e4fe3871827cad70128c73cfdca725f3a32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Lind=C3=A9n?= Date: Wed, 11 May 2016 15:37:47 +0200 Subject: [PATCH] Presumed fix of exception when closing application window. --- src/com/mrcrayfish/modelcreator/ModelCreator.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/com/mrcrayfish/modelcreator/ModelCreator.java b/src/com/mrcrayfish/modelcreator/ModelCreator.java index e27fe59..c1b6576 100644 --- a/src/com/mrcrayfish/modelcreator/ModelCreator.java +++ b/src/com/mrcrayfish/modelcreator/ModelCreator.java @@ -157,6 +157,16 @@ public void windowClosing(WindowEvent e) { Display.create(); + Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() + { + @Override + public void uncaughtException (Thread thread, final Throwable ex) + { + Display.destroy(); + System.exit(0); + } + }); + WelcomeDialog.show(ModelCreator.this); loop();