Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2010-04-20 12:29:10 -0400
committerThomas Watson2010-04-20 12:29:10 -0400
commit1dde39a3ffe5d86c73562c80534e81aa7d051e5d (patch)
tree04410d81c2f3f84d7cbcec3470cb0759afc725ee
parentfe8e29e29e97c2c8ad6864f9f3f68508683d69ea (diff)
downloadrt.equinox.framework-1dde39a3ffe5d86c73562c80534e81aa7d051e5d.tar.gz
rt.equinox.framework-1dde39a3ffe5d86c73562c80534e81aa7d051e5d.tar.xz
rt.equinox.framework-1dde39a3ffe5d86c73562c80534e81aa7d051e5d.zip
Bug 309763 - StateSaver causes a NullPointerException on calling exit in the console
-rw-r--r--bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/internal/baseadaptor/BaseStorage.java12
1 files changed, 8 insertions, 4 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 48d31e56b..82263d10b 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
@@ -1265,14 +1265,18 @@ public class BaseStorage implements SynchronousBundleListener {
if (runningThread == null) {
shutdownHook = new Thread(new Runnable() {
public void run() {
- synchronized (systemState) {
- saveAllData(false);
- }
+ // Synchronize with JVM shutdown hook, because
+ // saveAllData creates a temp file with delete on
+ // exit is true. The temp file will be removed in the
+ // shutdown hook. This prevents that the remove temp files
+ // in the shutdown hook is earlier handled then adding new
+ // temp file in saveAllData.
+ shutdown();
}
});
- Runtime.getRuntime().addShutdownHook(shutdownHook);
runningThread = new Thread(this, "State Saver"); //$NON-NLS-1$
runningThread.start();
+ Runtime.getRuntime().addShutdownHook(shutdownHook);
}
}
}

Back to the top