How to dispose of SWTImage objects? [message #190252] |
Fri, 30 May 2008 10:23 |
Barbara Rosi-Schwartz Messages: 448 Registered: July 2009 |
Senior Member |
|
|
Hi.
I am using a RenderedImage and an extension to ScalableImageFigure to
display SVG images on a diagram's canvas. The SVG images are selected
from the filesystem by the user.
I have been trying to dispose of the created SWT images that underlie
the RenderedImage objects when the editor is disposed, but I have found
that this causes havoc: when I reopen the editor on the same diagram or
on a different diagram, some of my iamge nodes do not display anything.
In looking through the code, I found that the RenderedImageFactory,
which I use to create the RenderedImage objects, caches images in a
static imageMap. I am therefore wondering if, in my disposal, I am
interfering with that caching mechanism and if this is the reason why
some of my images disappear from the editors.
Any ideas? Do I even need to dispose of the SWT images?
TIA,
B.
--
Barbara Rosi-Schwartz
Etish Limited [http://www.etish.org]
Blog: http://www.brs4etish.blogspot.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
^...^
/ o,o \ The proud parents of Useme
|) ::: (| The Open Requirements Management Tool
====w=w==== [https://useme.dev.java.net]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
Re: How to dispose of SWTImage objects? [message #190295 is a reply to message #190252] |
Fri, 30 May 2008 13:09 |
Eclipse User |
|
|
|
Originally posted by: jan.herriger.gmx.de
Hi Barbara,
> Any ideas? Do I even need to dispose of the SWT images?
not really sure, but AFAIK it is even prohibited to dispose of those
images. At least, this is true for images, managed by JFace ImageRegistry.
|
|
|
|
Powered by
FUDForum. Page generated in 0.04548 seconds