Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » disposing class attributes
disposing class attributes [message #449483] Tue, 25 January 2005 13:16 Go to next message
Pavel Trka is currently offline Pavel TrkaFriend
Messages: 14
Registered: July 2009
Junior Member
Hi !

Im relatively new to swt programming... I have a question: I have a
widget that extends Composite and I want to know how to properly
dispose resources allocated by instances of my class...

I know that making it in finalizer is very bad idea so I searched a
little bit and I think that I will implement DisposeLitener interface
on my class and register it in as disposeListener in constructor...
then I will implement widgetDisposed() method where I will do needed
resource disposing...

Is it the right way ?

Im working only on small part of bigger eclipse plugin so I rely on
fact that somewhere "higher" is my widget properly disposed - Im not
responsible for creating it etc, I only changed some internals and now
I need to dispose some internal attributes upon closing of this
widget...

Thank for any answer...
Re: disposing class attributes [message #449501 is a reply to message #449483] Tue, 25 January 2005 14:54 Go to previous messageGo to next message
Stefan Pietsch is currently offline Stefan PietschFriend
Messages: 68
Registered: July 2009
Member
Hi Pavel,

you are right!

Bye Stefan

"Pavel Trka" <voidx@atlas.cz> schrieb im Newsbeitrag
news:ct5gs0$3t5$1@www.eclipse.org...
> Hi !
>
> Im relatively new to swt programming... I have a question: I have a
> widget that extends Composite and I want to know how to properly
> dispose resources allocated by instances of my class...
>
> I know that making it in finalizer is very bad idea so I searched a
> little bit and I think that I will implement DisposeLitener interface
> on my class and register it in as disposeListener in constructor...
> then I will implement widgetDisposed() method where I will do needed
> resource disposing...
>
> Is it the right way ?
>
> Im working only on small part of bigger eclipse plugin so I rely on
> fact that somewhere "higher" is my widget properly disposed - Im not
> responsible for creating it etc, I only changed some internals and now
> I need to dispose some internal attributes upon closing of this
> widget...
>
> Thank for any answer...
>
Re: disposing class attributes [message #449514 is a reply to message #449501] Tue, 25 January 2005 16:10 Go to previous message
Pavel Trka is currently offline Pavel TrkaFriend
Messages: 14
Registered: July 2009
Junior Member
Thanks, glad to hear it ;)

Stefan Pietsch wrote:

> Hi Pavel,
>
> you are right!
>
> Bye Stefan
>
Previous Topic:Adding / Removing TableColumns on-the-fly
Next Topic:How to make SWT application appear in task bar on Windows XP
Goto Forum:
  


Current Time: Fri Apr 26 21:52:03 GMT 2024

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

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

Back to the top