diff options
author | Thomas Watson | 2010-04-20 16:29:10 +0000 |
---|---|---|
committer | Thomas Watson | 2010-04-20 16:29:10 +0000 |
commit | 1dde39a3ffe5d86c73562c80534e81aa7d051e5d (patch) | |
tree | 04410d81c2f3f84d7cbcec3470cb0759afc725ee /bundles/org.eclipse.osgi | |
parent | fe8e29e29e97c2c8ad6864f9f3f68508683d69ea (diff) | |
download | rt.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
Diffstat (limited to 'bundles/org.eclipse.osgi')
-rw-r--r-- | bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/internal/baseadaptor/BaseStorage.java | 12 |
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); } } } |