Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Alexander Kuppe2010-10-31 04:30:52 -0400
committerMarkus Alexander Kuppe2010-10-31 04:30:52 -0400
commit499b128c851e82ac73ee28602bfd7a56f18988b4 (patch)
treef71d7f07557dde8f625623f5de17971e8b26d1bd
parent70d9f8f7ac5efafabb406d52e2b79d4f2ecac5f6 (diff)
downloadorg.eclipse.ecf-499b128c851e82ac73ee28602bfd7a56f18988b4.tar.gz
org.eclipse.ecf-499b128c851e82ac73ee28602bfd7a56f18988b4.tar.xz
org.eclipse.ecf-499b128c851e82ac73ee28602bfd7a56f18988b4.zip
RESOLVED - bug 329155: BundleContext no longer valid when DiscoveryServiceListener gets disposed causes IllegalStateException
https://bugs.eclipse.org/bugs/show_bug.cgi?id=329155
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/DiscoveryPlugin.java4
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/DiscoveryServiceListener.java4
2 files changed, 7 insertions, 1 deletions
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/DiscoveryPlugin.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/DiscoveryPlugin.java
index bea3f881b..5cead024a 100644
--- a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/DiscoveryPlugin.java
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/DiscoveryPlugin.java
@@ -109,6 +109,10 @@ public class DiscoveryPlugin implements BundleActivator {
return plugin;
}
+ public static boolean isStopped() {
+ return plugin == null;
+ }
+
public BundleContext getBundleContext() {
return context;
}
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/DiscoveryServiceListener.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/DiscoveryServiceListener.java
index de9793659..396ca3397 100644
--- a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/DiscoveryServiceListener.java
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/DiscoveryServiceListener.java
@@ -51,7 +51,9 @@ public class DiscoveryServiceListener implements ServiceListener {
}
public void dispose() {
- context.removeServiceListener(this);
+ if (!DiscoveryPlugin.isStopped()) {
+ context.removeServiceListener(this);
+ }
}
private void addServiceListener(ServiceReference[] references) {

Back to the top