From 5e40bac32d20ce2385111a3f540ad29df0e581ec Mon Sep 17 00:00:00 2001 From: "gyeongseok.seo" Date: Tue, 12 Jul 2011 20:17:09 +0900 Subject: [PATCH] [Conn]Fixed - Null point Exception. -- Add DeviceChecker Thread stop code. Change-Id: I93e072d5379899412ee76b1ea2fc1375faaa1ac1 --- .../src/com/samsung/ide/connection/FreshConnectionActivator.java | 9 +++++++-- .../src/com/samsung/ide/connection/device/DeviceChecker.java | 5 +++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/com.samsung.ide.connection/src/com/samsung/ide/connection/FreshConnectionActivator.java b/com.samsung.ide.connection/src/com/samsung/ide/connection/FreshConnectionActivator.java index fcac0e5..6708aef 100644 --- a/com.samsung.ide.connection/src/com/samsung/ide/connection/FreshConnectionActivator.java +++ b/com.samsung.ide.connection/src/com/samsung/ide/connection/FreshConnectionActivator.java @@ -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); } diff --git a/com.samsung.ide.connection/src/com/samsung/ide/connection/device/DeviceChecker.java b/com.samsung.ide.connection/src/com/samsung/ide/connection/device/DeviceChecker.java index aa09b89..d7f61c7 100644 --- a/com.samsung.ide.connection/src/com/samsung/ide/connection/device/DeviceChecker.java +++ b/com.samsung.ide.connection/src/com/samsung/ide/connection/device/DeviceChecker.java @@ -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) { -- 2.7.4