Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » What should a view to dispose?
What should a view to dispose? [message #265492] Thu, 05 August 2004 05:37 Go to next message
Eclipse UserFriend
Originally posted by: jw.jwi.de

The SWT: The Standard Widget Toolkit PART 2: Managing Operating System
Resources ( http://www.eclipse.org/articles/swt-design-2/swt-design-2.ht ml)
article tells about about the need to dispose resources:

1) If you created it, you dispose it (if you didn't create it, don't
dispose it).
2) Disposing the parent disposes the children.

So, 2) should mean, that in a view you never have to dispose any widgets,
because all widgets have the view as parent and Eclipse disposes the view.
The only resources left (1) to dispose are Colors and Fonts.

Is that right?

Thanks,
Juergen
Re: What should a view to dispose? [message #265503 is a reply to message #265492] Thu, 05 August 2004 06:02 Go to previous message
Eclipse UserFriend
Juergen Weber schrieb:

> So, 2) should mean, that in a view you never have to dispose any widgets,
> because all widgets have the view as parent and Eclipse disposes the view.

Yes. See http://www.eclipse.org/articles/viewArticle/ViewArticle2.htm l
There you find:

....
When the view is closed the lifecycle is completed.

1. The parent Composite passed to createPartControl is disposed.
This children are also implicitly disposed. If you wish to run any code
at this time, you must hook the control dispose event.
2. The IViewPart.dispose method is called to terminate the part
lifecycle. This is the last method which the workbench will call on the
part. It is an ideal time to release any fonts, images, etc.
....

> The only resources left (1) to dispose are Colors and Fonts.

Images? And maybe still other things...

Ciao, Michael.
Previous Topic:StatusLine component positioning
Next Topic:Eclipse and WSIF
Goto Forum:
  


Current Time: Tue Jul 22 15:48:53 EDT 2025

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

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

Back to the top