disposing images created by a label provider [message #636671] |
Tue, 02 November 2010 08:41  |
Eclipse User |
|
|
|
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 11:19   |
Eclipse User |
|
|
|
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
|
|
|
|
Powered by
FUDForum. Page generated in 0.05335 seconds