Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Color and dispose
Color and dispose [message #445449] Fri, 05 November 2004 21:38 Go to next message
jmi is currently offline jmiFriend
Messages: 84
Registered: July 2009
Member
Hi,

When i do this:

public class MyTest extends Composite {
public MyTest (final Composite argParent, final int argStyle) {
super(argParent, SWT.NONE);
Color colorB = argParent.getDisplay()
.getSystemColor(SWT.COLOR_TITLE_BACKGROUND_GRADIENT);
setBackground(colorB);
}
....

Do i have to dispose the colorB to avoid memory leak ????

Thanks

JMi
Re: Color and dispose [message #445452 is a reply to message #445449] Fri, 05 November 2004 22:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

Not for system colors. You don't own them so you don't dispose them.

If instead you did a new color here, then yes you would need to dispose
it when no longer needed.


--
Thanks,
Rich Kulp
Re: Color and dispose [message #445479 is a reply to message #445452] Sat, 06 November 2004 10:24 Go to previous message
jmi is currently offline jmiFriend
Messages: 84
Registered: July 2009
Member
Thanks Rick

"Rich Kulp" <richkulp@us.NO_SPAM.ibm.com> wrote in message
news:cmgvst$69s$1@eclipse.org...
> Not for system colors. You don't own them so you don't dispose them.
>
> If instead you did a new color here, then yes you would need to dispose it
> when no longer needed.
>
>
> --
> Thanks,
> Rich Kulp
Previous Topic:How to set the item Height
Next Topic:Hiding / closing / myShell
Goto Forum:
  


Current Time: Tue Oct 27 07:54:39 GMT 2020

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

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

Back to the top