patch SWT/JFreechart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
cchab
Posts: 3
Joined: Tue May 22, 2007 4:07 pm

patch SWT/JFreechart

Post by cchab » Tue May 22, 2007 4:54 pm

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

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Tue May 22, 2007 5:08 pm

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

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

heprom
Posts: 91
Joined: Sat May 27, 2006 4:25 am
Location: Paris

Post by heprom » Wed May 23, 2007 9:36 pm

The patch has been commited to CVS. Thanks for those who reported problems and thanks to Cédric for the patch.

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Thu May 24, 2007 9:53 am

Thanks Henry! Thanks Cédric!
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

pcentgraf
Posts: 2
Joined: Tue Oct 02, 2007 10:06 pm

Missed One

Post by pcentgraf » Mon Dec 17, 2007 11:45 pm

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.

dngrmoose
Posts: 1
Joined: Fri May 09, 2008 12:28 am

Post by dngrmoose » Fri May 09, 2008 12:32 am

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.

heprom
Posts: 91
Joined: Sat May 27, 2006 4:25 am
Location: Paris

Post by heprom » Sat May 24, 2008 8:02 pm

Thanks for the comments, I've updated the SWTGraphics2D with a new pool for transform objects and ChartComposite with some fixes too.

Locked