Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » FormColors does not provide a way to destroy a color in 3.4
FormColors does not provide a way to destroy a color in 3.4 [message #333080] Mon, 24 November 2008 22:10 Go to next message
Lidija Grahek is currently offline Lidija GrahekFriend
Messages: 1
Registered: July 2009
Junior Member
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 Go to previous message
Daniel Krügler is currently offline Daniel KrüglerFriend
Messages: 853
Registered: July 2009
Senior Member
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
Previous Topic:Lateral menu using fast view / Presentation framework
Next Topic:Problems sending simple emails
Goto Forum:
  


Current Time: Sat Apr 27 00:36:32 GMT 2024

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

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

Back to the top