Author: yradtsevich
Date: 2011-11-23 13:18:45 -0500 (Wed, 23 Nov 2011)
New Revision: 36571
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeResourcesDialog.java
Log:
https://issues.jboss.org/browse/JBIDE-10221 /
https://issues.jboss.org/browse/JBIDE-10222 : VpeController has resource leaks
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeResourcesDialog.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeResourcesDialog.java 2011-11-23
17:57:02 UTC (rev 36570)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeResourcesDialog.java 2011-11-23
18:18:45 UTC (rev 36571)
@@ -20,8 +20,11 @@
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
@@ -70,8 +73,14 @@
protected Control createDialogArea(Composite parent) {
getShell().setText(Messages.VRD_DEFAULT_WINDOW_TITLE);
setTitle(Messages.VRD_DEFAULT_TITLE);
- setTitleImage(ModelUIImages.getImageDescriptor(
- ModelUIImages.WIZARD_DEFAULT).createImage(null));
+ final Image wizardDefaultImage = ModelUIImages.getImageDescriptor(
+ ModelUIImages.WIZARD_DEFAULT).createImage(null);
+ setTitleImage(wizardDefaultImage);
+ parent.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ wizardDefaultImage.dispose();
+ }
+ });
setMessage(Messages.VRD_PAGE_DESIGN_OPTIONS_ABOUT);
Composite composite = new Composite(parent, SWT.NONE);