Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » How to dispose of SWTImage objects?
How to dispose of SWTImage objects? [message #190252] Fri, 30 May 2008 10:23 Go to next message
Barbara Rosi-Schwartz is currently offline Barbara Rosi-SchwartzFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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.
Re: How to dispose of SWTImage objects? [message #190310 is a reply to message #190295] Fri, 30 May 2008 14:16 Go to previous message
Barbara Rosi-Schwartz is currently offline Barbara Rosi-SchwartzFriend
Messages: 448
Registered: July 2009
Senior Member
On 2008-05-30 14:09:12 +0100, Jan Herriger <jan.herriger@gmx.de> said:

> 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.

Thanks, but are these actually managed by the ImageRegistry? I have not
seen that happening in my debugging meanderings.

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]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Previous Topic:How to detect when a delete request is user generated
Next Topic:Compartment and External Label - impossible?
Goto Forum:
  


Current Time: Fri Apr 26 15:34:56 GMT 2024

Powered by FUDForum. Page generated in 0.04548 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top