Re: [tcljava-dev] bug 2866640, tclblend - potential memory leak
Brought to you by:
mdejong
From: Mo D. <mo...@mo...> - 2010-04-06 08:15:43
|
Hi Anthony Wow, that was a tricky bug to figure out the proper fix for. Please try out Patch 2982514, it should address the leak you were seeing, but verification of the fix is needed. I will append it to this email since it is very small. Mo DeJong RCS file: /cvsroot/tcljava/tcljava/src/native/javaObj.c,v retrieving revision 1.17 diff -u -r1.17 javaObj.c --- src/native/javaObj.c 31 Dec 2002 20:16:27 -0000 1.17 +++ src/native/javaObj.c 6 Apr 2010 08:00:36 -0000 @@ -233,6 +233,13 @@ jobject exception; /* + * If object was freed already, or if the ptr2 field was + * explicitly set to NULL, then do nothing. + */ + if (object == NULL) + return; + + /* * Clear pending Java exception. */ @@ -969,8 +976,8 @@ if (objPtr->bytes == NULL) { UpdateTclObject(objPtr); } - objPtr->typePtr = NULL; ptr2 = objPtr->internalRep.twoPtrValue.ptr2; + objPtr->internalRep.twoPtrValue.ptr2 = NULL; result = (oldCmdType.setFromAnyProc)(interp, objPtr); objPtr->internalRep.twoPtrValue.ptr2 = ptr2; } else { Anthony Borthwick wrote: > Hi, > > I added some test code to the bug report which demonstrates this issue. > Is there any news? > > Tony > > -----Original Message----- > From: Mo DeJong [mailto:mo...@mo...] > Sent: 04 February 2010 19:33 > To: discuss implementaition and patches here > Subject: Re: [tcljava-dev] bug 2866640, tclblend - potential memory leak > > Anthony Borthwick wrote: > >> Hi, >> >> >> >> Just wondering if anything is being done with this issue >> >> >> >> >> > http://sourceforge.net/tracker/?func=detail&aid=2866640&group_id=13005&a > tid=113005 > > <http://sourceforge.net/tracker/?func=detail&aid=2866640&group_id=13005& > atid=113005> > >> >> >> Tony >> >> >> > Memory leak? Well, I am willing to take a look at it today. But, could > you provide a small script example that demonstrates how this bug can be > > reproduced? Often, it is very difficult to figure out how to reproduce > the problem without an example of how to generate the bug. You could > post it here or append it to the bug report. > > Mo > |