skin: add Timer for shell closing 41/27741/2
authorGiWoong Kim <giwoong.kim@samsung.com>
Thu, 18 Sep 2014 10:19:46 +0000 (19:19 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Wed, 24 Sep 2014 02:27:59 +0000 (19:27 -0700)
Change-Id: I169713e7667c1983a672c0eafdde2634abbb05ee
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java

index e4a959d..ca29027 100755 (executable)
@@ -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);