Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » disposing images created by a label provider
disposing images created by a label provider [message #636671] Tue, 02 November 2010 12:41 Go to next message
Luca Ferrari is currently offline Luca Ferrari
Messages: 159
Registered: November 2009
Senior Member
Hi, following the rule that if you create them, you must dispose them I'd like to dispose a set of images created in a label provider used within a table viewer. The problem is that the label provider do not provide a dispose method (implementing ITableLabelProvider), so I don't know how to do this, and using finalizers does not sound good to me.
Maybe I'm doing wrong this, and instead of using the label provider to keep track of images I should use the ImageRegistry. Can anyone give me a clue of what is the right way of managing images required by a a label provider?

Thanks.
Re: disposing images created by a label provider [message #636732 is a reply to message #636671] Tue, 02 November 2010 15:19 Go to previous messageGo to next message
Daniel Krügler is currently offline Daniel Krügler
Messages: 853
Registered: July 2009
Senior Member
On 02.11.2010 13:41, Luca Ferrari wrote:
> Hi, following the rule that if you create them, you must dispose them
> I'd like to dispose a set of images created in a label provider used
> within a table viewer. The problem is that the label provider do not
> provide a dispose method (implementing ITableLabelProvider), so I don't
> know how to do this, and using finalizers does not sound good to me.
> Maybe I'm doing wrong this, and instead of using the label provider to
> keep track of images I should use the ImageRegistry. Can anyone give me
> a clue of what is the right way of managing images required by a a label
> provider?

You are misinformed. Each label provider (including ITableLabelProvider)
has a dispose method from IBaseLabelProvider, which becomes
automatically called by the viewer, when it is disposed. We take
advantage of this feature in mayn of our label providers.

HTH & Greetings from Bremen,

Daniel Krügler
Re: disposing images created by a label provider [message #636921 is a reply to message #636732] Wed, 03 November 2010 11:32 Go to previous message
Luca Ferrari is currently offline Luca Ferrari
Messages: 159
Registered: November 2009
Senior Member
Thanks, I misread the documentation. Very Happy
Previous Topic:Exporting a features dependencies?
Next Topic:BrowserFunction does not work in exported product
Goto Forum:
  


Current Time: Fri Sep 19 09:53:58 GMT 2014

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

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