skin: add Timer for shell closing
authorGiWoong Kim <giwoong.kim@samsung.com>
Thu, 18 Sep 2014 10:19:46 +0000 (19:19 +0900)
committerGiWoong Kim <giwoong.kim@samsung.com>
Thu, 18 Sep 2014 10:19:46 +0000 (19:19 +0900)
Change-Id: I169713e7667c1983a672c0eafdde2634abbb05ee
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java

index 9a8aa996c850244ef588ec1533f4e62778870fb3..e629aeef5ddb0990715c525e29f6ad1b442e9f6d 100755 (executable)
@@ -159,6 +159,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);
@@ -413,6 +415,7 @@ public class EmulatorSkin {
                                logger.info("Main Window is closed");
 
                                if (isShutdownRequested) {
+                                       closeTimer.cancel();
                                        removeShellListeners();
                                        removeCanvasListeners();
 
@@ -501,7 +504,7 @@ public class EmulatorSkin {
                                                         * sleep function. So, we need a bigger value than
                                                         * that.
                                                         */
-                                                       new Timer().schedule(new TimerTask() {
+                                                       closeTimer.schedule(new TimerTask() {
                                                                @Override
                                                                public void run() {
                                                                        demanderFlag.set(false);