summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorMarkus Keller2011-01-12 10:34:33 (EST)
committer Dani Megert2011-10-06 03:45:17 (EDT)
commit26172791b6188da0611d1b7b104737c2b10aed9c (patch)
tree3a9a64d0028a8ed7708dc87c4982b7b1029c593f
parent83adb65957048cf7daf92f81c3e5ce515ff7525b (diff)
downloadeclipse.platform.ui-26172791b6188da0611d1b7b104737c2b10aed9c.zip
eclipse.platform.ui-26172791b6188da0611d1b7b104737c2b10aed9c.tar.gz
eclipse.platform.ui-26172791b6188da0611d1b7b104737c2b10aed9c.tar.bz2
Bug 334125: StatusPart.createShowLogButton(..) leaks an image
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/part/StatusPart.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/part/StatusPart.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/part/StatusPart.java
index 3edea87..0c6347f 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/part/StatusPart.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/part/StatusPart.java
@@ -12,11 +12,12 @@ package org.eclipse.ui.internal.part;
import java.io.PrintWriter;
import java.io.StringWriter;
-
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Color;
@@ -206,8 +207,13 @@ public class StatusPart {
}
}
});
- button.setImage(descriptor.getImageDescriptor().createImage());
- button
- .setToolTipText(WorkbenchMessages.ErrorLogUtil_ShowErrorLogTooltip);
+ final Image image = descriptor.getImageDescriptor().createImage();
+ button.setImage(image);
+ button.setToolTipText(WorkbenchMessages.ErrorLogUtil_ShowErrorLogTooltip);
+ button.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ image.dispose();
+ }
+ });
}
}