Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/console/ConsoleSession.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/console/ConsoleSession.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/console/ConsoleSession.java
index 0dbbfc17a..bb43b14ec 100644
--- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/console/ConsoleSession.java
+++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/console/ConsoleSession.java
@@ -40,8 +40,16 @@ public abstract class ConsoleSession implements ServiceFactory {
public final void close() {
doClose();
ServiceRegistration current = sessionRegistration;
- if (current != null)
- current.unregister();
+ if (current != null) {
+ sessionRegistration = null;
+ try {
+ current.unregister();
+ } catch (IllegalStateException e) {
+ // This can happen if the service is in the process of being
+ // unregistered or if another thread unregistered the service.
+ // Ignoring the exception.
+ }
+ }
}
/**

Back to the top