Skip to main content



      Home
Home » Eclipse Projects » GEF » What is the Best place to dispose Images
What is the Best place to dispose Images [message #167530] Wed, 09 February 2005 09:39 Go to next message
Eclipse UserFriend
Hi,
If i have a figure which internaly instantiates
org.eclipse.swt.graphics.Image
Where is the best place to call .dispose() on image

My solution was:

Editpart.deactivate()->MyFigure.destroy().->image.dispose()
Method destroy is my own not any inherted.

I'm interested in standartized solution.
Thanks,
Karel
Re: What is the Best place to dispose Images [message #167583 is a reply to message #167530] Wed, 09 February 2005 15:23 Go to previous message
Eclipse UserFriend
Originally posted by: bo.n0spam.majewski.com

> Editpart.deactivate()->MyFigure.destroy().->image.dispose()
> Method destroy is my own not any inherted.

You could always keep the image in the edit part and dispose it when it
is deactivated. In this solution the figure just holds a reference to
the image, but does not own the image. So you have

EditPart.refreshVisuals -> MyFigure.setImage
EditPart.deactivate -> image.dipose
Re: What is the Best place to dispose Images [message #167614 is a reply to message #167530] Wed, 09 February 2005 14:55 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

You probably have multiple instances of that figure, so the figure is not
the best place to manage a resource. But what you have should work.

"b00lean" <kk@cleverlance.com> escreveu na mensagem
news:cud7bo$min$1@www.eclipse.org...
> Hi,
> If i have a figure which internaly instantiates
> org.eclipse.swt.graphics.Image
> Where is the best place to call .dispose() on image
>
> My solution was:
>
> Editpart.deactivate()->MyFigure.destroy().->image.dispose()
> Method destroy is my own not any inherted.
>
> I'm interested in standartized solution.
> Thanks,
> Karel
>
>
>
Previous Topic:Scrolling viewer while draging/resizing
Next Topic:Create a special figure
Goto Forum:
  


Current Time: Tue Jun 24 13:27:25 EDT 2025

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

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

Back to the top