#752 SWT Dynamic Chart


In the class SWTGraphics2D, there are 3 TODO on 3 dispose call (in setFont(Font font), setBackGround and setForeGround).

I think that the answer to the question about the need to explicitly call "dispose" is yes.

I'm using JFreeChart in an eclipse view to do some dynamic chart and run out of handle after an amont of time.

With adding some "dispose" calls to the previous methods, I don't.

PS : Thanks for that great lib !


  • Henry Proudhon

    Henry Proudhon - 2007-05-16
    • assigned_to: nobody --> nenry
  • Henry Proudhon

    Henry Proudhon - 2007-05-16

    Logged In: YES
    Originator: NO


    This has already been discussed on the forum with slient. If you use the last cvs version, two of the TODO have been removed and dispose method added. We create a new Color and dispose the old one each time SetFore/Background is called. For the font, this is more complex since we do not want to dispose a resource if other widget have reference on it. At the moment I'm reviewing the various options. I'm considering adding a font registry where we keep the references of the existing fonts and dispose them when they are not used anymore.

    Thanks for the feedback,



Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks