Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2012-03-15 17:34:21 +0000
committerThomas Watson2012-03-15 18:17:00 +0000
commit17a98f4def298e1a254c1c07c7f22ea088dbc08b (patch)
tree002b87780b091a5940910b7700d7f5513211592b
parent5a42c6ea2f82c3769228b69b3b1e4d706e0f0f4e (diff)
downloadrt.equinox.framework-17a98f4def298e1a254c1c07c7f22ea088dbc08b.tar.gz
rt.equinox.framework-17a98f4def298e1a254c1c07c7f22ea088dbc08b.tar.xz
rt.equinox.framework-17a98f4def298e1a254c1c07c7f22ea088dbc08b.zip
Bug 374300 - Should protect against adding vm shutdown hooks when the VM is in the process of being shutdownR36x_v20120315
-rw-r--r--bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/internal/baseadaptor/BaseStorage.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/internal/baseadaptor/BaseStorage.java b/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/internal/baseadaptor/BaseStorage.java
index 5d197d583..2da9898c1 100644
--- a/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/internal/baseadaptor/BaseStorage.java
+++ b/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/internal/baseadaptor/BaseStorage.java
@@ -1284,7 +1284,11 @@ public class BaseStorage implements SynchronousBundleListener {
});
runningThread = new Thread(this, "State Saver"); //$NON-NLS-1$
runningThread.start();
- Runtime.getRuntime().addShutdownHook(shutdownHook);
+ try {
+ Runtime.getRuntime().addShutdownHook(shutdownHook);
+ } catch (IllegalStateException e) {
+ // bug 374300 - need to ignore this in case the VM is being shutdown
+ }
}
}
}

Back to the top