Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2008-04-17 15:54:32 -0400
committerThomas Watson2008-04-17 15:54:32 -0400
commit6364494770a1e266edefa51a0d7e5702857a963f (patch)
treec332e573c71806299965c2a357b0156ba54a08d0 /bundles
parente02cbe47e402465dd3f4febd7fed76fe7271f146 (diff)
downloadrt.equinox.framework-6364494770a1e266edefa51a0d7e5702857a963f.tar.gz
rt.equinox.framework-6364494770a1e266edefa51a0d7e5702857a963f.tar.xz
rt.equinox.framework-6364494770a1e266edefa51a0d7e5702857a963f.zip
Bug 225465 IOException causing 1G of .lazyX.new over a 2-3 month period
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/internal/baseadaptor/BaseStorage.java11
1 files changed, 9 insertions, 2 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 379823857..bc43ad7be 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
@@ -584,9 +584,11 @@ public class BaseStorage implements SynchronousBundleListener {
stateManager.getSystemState().setTimeStamp(stateManager.getSystemState().getTimeStamp() + 1);
if (stateManager == null || isReadOnly() || !stateManager.saveNeeded())
return;
+ File stateTmpFile = null;
+ File lazyTmpFile = null;
try {
- File stateTmpFile = File.createTempFile(LocationManager.STATE_FILE, ".new", LocationManager.getOSGiConfigurationDir()); //$NON-NLS-1$
- File lazyTmpFile = File.createTempFile(LocationManager.LAZY_FILE, ".new", LocationManager.getOSGiConfigurationDir()); //$NON-NLS-1$
+ stateTmpFile = File.createTempFile(LocationManager.STATE_FILE, ".new", LocationManager.getOSGiConfigurationDir()); //$NON-NLS-1$
+ lazyTmpFile = File.createTempFile(LocationManager.LAZY_FILE, ".new", LocationManager.getOSGiConfigurationDir()); //$NON-NLS-1$
if (shutdown)
stateManager.shutdown(stateTmpFile, lazyTmpFile);
else
@@ -598,6 +600,11 @@ public class BaseStorage implements SynchronousBundleListener {
storageManager.update(new String[] {LocationManager.STATE_FILE, LocationManager.LAZY_FILE}, new String[] {stateTmpFile.getName(), lazyTmpFile.getName()});
} catch (IOException e) {
adaptor.getFrameworkLog().log(new FrameworkEvent(FrameworkEvent.ERROR, context.getBundle(), e));
+ } finally {
+ if (stateTmpFile != null && stateTmpFile.exists())
+ stateTmpFile.delete();
+ if (lazyTmpFile != null && lazyTmpFile.exists())
+ lazyTmpFile.delete();
}
}

Back to the top