From 44977c67a0af5d44cc72c42eb46b0a4d94e63bee Mon Sep 17 00:00:00 2001 From: Dmitry Kryukov Date: Thu, 29 Nov 2018 14:28:03 -0500 Subject: [PATCH] comment --- src/game/ui/Main.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/game/ui/Main.java b/src/game/ui/Main.java index 1961f20..253d7c0 100644 --- a/src/game/ui/Main.java +++ b/src/game/ui/Main.java @@ -118,7 +118,7 @@ public JFrame createAndShowGui(boolean tournament) { if (game.getGameState().isTurnament()) { frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); - + // no matter how many thread you have, it will block it till you finish with the previous Thread t = new Thread() { public void run() { synchronized (lock) { @@ -139,6 +139,7 @@ public void run() { public void windowClosing(WindowEvent arg0) { synchronized (lock) { frame.setVisible(false); + // free thread when you finish with previous lock.notify(); } }