Hi Stefan,
just to be sure, there are many places we create Color() objects, but we
never dispose them. The API documentation says :
"You must dispose the color when it is no longer required."
I was thiunking about moving the color declaration to the
CommonUIConstants class, and free them in the CommonUIPlugin class, tjis
way :
in CommonUIConstants :
public static final Color BLACK_COLOR = new Color( null, BLACK );
and in CommonUIPlugin :
public void stop( BundleContext context ) throws Exception
{
plugin = null;
// Dispose the colors
CommonUIConstants.BLACK_COLOR.dispose();
CommonUIConstants.WHITE_COLOR.dispose();
...
Do you think this is correct ?
For specific colors, I think creating them in the Plugin where they are
used, and disposing them there too is the right way.
wdyt ?