Skip to main content



      Home
Home » Eclipse Projects » GEF » ScrollableThumbnail - image disposal
ScrollableThumbnail - image disposal [message #86715] Tue, 08 July 2003 10:31 Go to next message
Eclipse UserFriend
Hi,

In the ScrollableThumbnail class, when deactivate() is called, the
super.deactivate() declared in Thumbnail - in turn calls
updater.deactivate().

The ThumbnailUpdater class deactivate() method calls dispose on the
Thumbnail image.

public void deactivate() {
setActive(false);
stop();
if (thumbnailImage != null) {
thumbnailImage.dispose();
thumbnailImage = null;
thumbnailImageSize = null;
}
}

When you create an instance of ScrollableThumbnail, a SelectorFigure is
created in the initialize method. This SelectorFigure also has an
image. This image is disposed of in the finalize method.

Is there a reason as to why these two ScrollableThumbnail specific
images are being disposed of at different times? Why would they not
both be disposed of on deactivate?

Regards,
Stephanie
Re: ScrollableThumbnail - image disposal [message #86871 is a reply to message #86715] Fri, 11 July 2003 16:01 Go to previous messageGo to next message
Eclipse UserFriend
I'm not sure why it was done this way. I agree the SelectorFigure's image
should be disposed of during deactivate() and not finalize(). I'll look into
making this change.

Eric


S Chafe wrote:

> Hi,
>
> In the ScrollableThumbnail class, when deactivate() is called, the
> super.deactivate() declared in Thumbnail - in turn calls
> updater.deactivate().
>
> The ThumbnailUpdater class deactivate() method calls dispose on the
> Thumbnail image.
>
> public void deactivate() {
> setActive(false);
> stop();
> if (thumbnailImage != null) {
> thumbnailImage.dispose();
> thumbnailImage = null;
> thumbnailImageSize = null;
> }
> }
>
> When you create an instance of ScrollableThumbnail, a SelectorFigure is
> created in the initialize method. This SelectorFigure also has an
> image. This image is disposed of in the finalize method.
>
> Is there a reason as to why these two ScrollableThumbnail specific
> images are being disposed of at different times? Why would they not
> both be disposed of on deactivate?
>
> Regards,
> Stephanie
>
>
>
Re: ScrollableThumbnail - image disposal [message #87152 is a reply to message #86871] Mon, 14 July 2003 11:26 Go to previous message
Eclipse UserFriend
Great, thanks.

Eric Bordeau wrote:

> I'm not sure why it was done this way. I agree the SelectorFigure's image
> should be disposed of during deactivate() and not finalize(). I'll look into
> making this change.
>
> Eric
>
> S Chafe wrote:
>
> > Hi,
> >
> > In the ScrollableThumbnail class, when deactivate() is called, the
> > super.deactivate() declared in Thumbnail - in turn calls
> > updater.deactivate().
> >
> > The ThumbnailUpdater class deactivate() method calls dispose on the
> > Thumbnail image.
> >
> > public void deactivate() {
> > setActive(false);
> > stop();
> > if (thumbnailImage != null) {
> > thumbnailImage.dispose();
> > thumbnailImage = null;
> > thumbnailImageSize = null;
> > }
> > }
> >
> > When you create an instance of ScrollableThumbnail, a SelectorFigure is
> > created in the initialize method. This SelectorFigure also has an
> > image. This image is disposed of in the finalize method.
> >
> > Is there a reason as to why these two ScrollableThumbnail specific
> > images are being disposed of at different times? Why would they not
> > both be disposed of on deactivate?
> >
> > Regards,
> > Stephanie
> >
> >
> >
Previous Topic:Question on EditParts as an IPropertySource
Next Topic:question about objects created in the palette
Goto Forum:
  


Current Time: Sat Jul 19 00:35:52 EDT 2025

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

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

Back to the top