[Conn]Fixed - Null point Exception.
authorgyeongseok.seo <gyeongseok.seo@samsung.com>
Tue, 12 Jul 2011 11:17:09 +0000 (20:17 +0900)
committergyeongseok.seo <gyeongseok.seo@samsung.com>
Tue, 12 Jul 2011 11:17:09 +0000 (20:17 +0900)
  -- Add DeviceChecker Thread stop code.
Change-Id: I93e072d5379899412ee76b1ea2fc1375faaa1ac1

com.samsung.ide.connection/src/com/samsung/ide/connection/FreshConnectionActivator.java
com.samsung.ide.connection/src/com/samsung/ide/connection/device/DeviceChecker.java

index fcac0e5..6708aef 100644 (file)
@@ -32,7 +32,9 @@ public class FreshConnectionActivator extends AbstractUIPlugin {
     private ImageLoader mLoader;
        // The shared instance
        private static FreshConnectionActivator plugin;
-       
+
+       DeviceChecker deviceChecker;
+
        /**
         * The constructor
         */
@@ -57,7 +59,8 @@ public class FreshConnectionActivator extends AbstractUIPlugin {
                        this.OS = this.LINUX;   
                
                mLoader = new ImageLoader(this);
-               new DeviceChecker().start();
+               deviceChecker = new DeviceChecker();
+               deviceChecker.start();
                
                UIJob job = new UIJob("Connect LocalMachine...") {
 
@@ -82,6 +85,8 @@ public class FreshConnectionActivator extends AbstractUIPlugin {
         * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
         */
        public void stop(BundleContext context) throws Exception {
+               if (deviceChecker != null)
+                       deviceChecker.stop();
                plugin = null;
                super.stop(context);
        }
index aa09b89..d7f61c7 100644 (file)
@@ -38,6 +38,11 @@ public class DeviceChecker extends Thread{
        
        String INTERFACE_NAME = null;
        
+       public DeviceChecker() {
+               setName("DeviceChecker");
+               setDaemon(true); // Marks this thread as either a daemon thread or a user thread. The Java Virtual Machine exits when the only threads running are all daemon threads.
+       }
+       
        public void run() {
                UIJob job = null;
                while (this.isActive) {