Author: yradtsevich
Date: 2011-11-23 09:17:26 -0500 (Wed, 23 Nov 2011)
New Revision: 36566
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/TextFormattingToolBar.java
Log:
https://issues.jboss.org/browse/JBIDE-10221 /
https://issues.jboss.org/browse/JBIDE-10202 : VPE resource leak in TextFormattingToolBar
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/TextFormattingToolBar.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/TextFormattingToolBar.java 2011-11-23
13:56:47 UTC (rev 36565)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/TextFormattingToolBar.java 2011-11-23
14:17:26 UTC (rev 36566)
@@ -177,7 +177,7 @@
* CSSStyleDialog should be on the Formatting toolbar.
*/
item = createToolItem(toolBar, SWT.PUSH,
- CSSPlugin.getImageDescriptor(Util.IMAGE_COLORLARGE_FILE_LOCATION).createImage(),
+ createImage(CSSPlugin.getImageDescriptor(Util.IMAGE_COLORLARGE_FILE_LOCATION)),
VpeUIMessages.EDIT_STYLE_ATTRIBUTE);
listener = new StyleFormatController(formatControllerManager, item);
item.addListener(SWT.Selection, listener);
@@ -208,10 +208,13 @@
}
private Image createImage(String path) {
- Image image = ImageDescriptor.createFromFile(MozillaEditor.class, path)
- .createImage();
+ ImageDescriptor imageDescriptor = ImageDescriptor.createFromFile(MozillaEditor.class,
path);
+ return createImage(imageDescriptor);
+ }
+
+ private Image createImage(ImageDescriptor imageDescriptor) {
+ Image image = imageDescriptor.createImage();
imagesList.add(image);
-
return image;
}
-}
\ No newline at end of file
+}