From dfa00a9a7b7ba19ae96e1ba2c264f04077bd7899 Mon Sep 17 00:00:00 2001 From: GiWoong Kim Date: Thu, 18 Sep 2014 19:19:46 +0900 Subject: [PATCH] skin: add Timer for shell closing Change-Id: I169713e7667c1983a672c0eafdde2634abbb05ee Signed-off-by: GiWoong Kim --- .../src/org/tizen/emulator/skin/EmulatorSkin.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java index e4a959d23f..ca29027acf 100755 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java @@ -161,6 +161,7 @@ public class EmulatorSkin { public boolean isKeyWindow; public boolean isOnKbd; private PopupMenu popupMenu; + private Timer closeTimer; public Color colorVM; private KeyWindowKeeper keyWindowKeeper; @@ -200,6 +201,7 @@ public class EmulatorSkin { this.isOnInterpolation = true; this.isOnKbd = false; this.isKeyWindow = false; + this.closeTimer = new Timer(); int style = SWT.NO_TRIM | SWT.DOUBLE_BUFFERED; this.shell = new Shell(Display.getDefault(), style); @@ -408,6 +410,7 @@ public class EmulatorSkin { logger.info("Main Window is closed"); if (isShutdownRequested) { + closeTimer.cancel(); removeShellListeners(); removeCanvasListeners(); @@ -490,10 +493,12 @@ public class EmulatorSkin { /* block for a while */ try { - /* In Close emulation, - * 1000ms parameter was used for sleep function. - * So, we need a bigger value than that.*/ - new Timer().schedule(new TimerTask() { + /* + * In Close emulation, 1000ms parameter was used for + * sleep function. So, we need a bigger value than + * that. + */ + closeTimer.schedule(new TimerTask() { @Override public void run() { demanderFlag.set(false); -- 2.34.1