I submitted today a patch concerning resource leaks concerning JFreeChart/SWT.
See patch "[ 1723543 ] SWT Resource leaks patch" on JFreeChart sourceforge page.
I used sleak to detect them.
Cédric
patch SWT/JFreechart
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Thanks. I'll try to take another look at the SWT stuff soon, but Henry Proudhon is the developer that works on it the most (he fixed a few bugs over the weekend, I notice).
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Thanks Henry! Thanks Cédric!
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


Missed One
FYI, SWTGraphics2D is still leaking SWT Transform objects in the setTransform(AffineTransform) method. I think you just need to add the Transform to the resource pool to take care of this.
pcentgraf - indeed you are correct. I am developing an Eclipse RCP application, and was getting SWT no more handles exceptions every now and again. I've made some changes to SWTGraphics2D which appears to have fixed the problem.
public void setTransform(AffineTransform Tx)
{
Transform t = toSwtTransform(Tx);
this.gc.setTransform(t);
addToResourcePool(t);
}
Additionally, when using the ChartComposite class, the buffered image is not cleaned up when the composite is disposed. Currently, I am disposing of this image myself when my containing widget is disposed.
public void setTransform(AffineTransform Tx)
{
Transform t = toSwtTransform(Tx);
this.gc.setTransform(t);
addToResourcePool(t);
}
Additionally, when using the ChartComposite class, the buffered image is not cleaned up when the composite is disposed. Currently, I am disposing of this image myself when my containing widget is disposed.