FormColors does not provide a way to destroy a color in 3.4 [message #333080] |
Mon, 24 November 2008 22:10  |
Eclipse User |
|
|
|
Hi,
I use FormColors.createColor(String key, RGB rgb) to create colors. In 3.4,
this method changed to use LocalResourceManager to share colors. This broke
my application since color.dispose() should not be called any more, it
disposes shared colors. I understand that ResourceManager expects
destroyColor to be called, rather than dispose. However, I don't see a way
to call LocalResourceManager.destroyColor(..). Since FormColors allowed me
to create the color, it seems reasonable to expect it to have destroyColor
method, that would do getResourceManager().destroyColor(...). Then, I could
replace my color.dispose() calls with FormColors.destroyColor(color).
Is there a workaround for this, or is this the bug?
Thanks!
Lidija
|
|
|
Re: FormColors does not provide a way to destroy a color in 3.4 [message #333082 is a reply to message #333080] |
Tue, 25 November 2008 08:27  |
Eclipse User |
|
|
|
Lidija Grahek wrote:
> I use FormColors.createColor(String key, RGB rgb) to create colors. In 3.4,
> this method changed to use LocalResourceManager to share colors. This broke
> my application since color.dispose() should not be called any more, it
> disposes shared colors.
This looks like a user error to me. I just checked Eclipse 3.3.2, where
the documentation of above mentioned method already says:
"Creates the color for the specified key using the provided RGB object.
The color object will be returned and also put into the registry. When
the class is disposed, the color will be disposed with it."
This has not been changed in Eclipse 3.4.1.
> I understand that ResourceManager expects
> destroyColor to be called, rather than dispose. However, I don't see a way
> to call LocalResourceManager.destroyColor(..). Since FormColors allowed me
> to create the color, it seems reasonable to expect it to have destroyColor
> method, that would do getResourceManager().destroyColor(...). Then, I could
> replace my color.dispose() calls with FormColors.destroyColor(color).
>
> Is there a workaround for this, or is this the bug?
Honestly I didn't understand the above paragraph at all because you
should not invoke any destroyColor invocation. You are supposed to call
FormColors#dispose, if it's life-time has ended.
Greetings from Bremen,
Daniel Krügler
|
|
|
Powered by
FUDForum. Page generated in 0.04077 seconds