Hi Jeremy,

Just FYI, the best way to submit patches is as follows:

- Run a cvs diff on each file you've changed;
- then submit each file *as an attachment* in a message to the list,
clearly indicating just what's being corrected.

As to the patches themselves:  I'm not expert in either area, but if Glenn
(or anyone else who is :-) ) says they're fine I'll certainly try to commit
them.

Cheers,
Neil

Neil Graham
XML Parser Development
IBM Toronto Lab
Phone:  416-448-3519, T/L 778-3519
E-mail:  [EMAIL PROTECTED]



Jeremy Carroll <[EMAIL PROTECTED]> on 08/06/2001 03:47:20 PM

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:
Subject:  Re: Fix for memory leak in StringReader



Unsurprisingly, my test code still is satisfactory with Glenn's variant
of the fix.

Jeremy


Glenn Marcy wrote:
>
> Jeremy,
>
> This part looks correct.  My only suggestion to improve the change is to
> split the cleanup responsibilities between the classes that define the
> data members (and add the fData field as well):
>
> In XMLEntityReader.java:
>
>     protected XMLEntityHandler.EntityReader changeReaders() throws
> Exception {
>         XMLEntityHandler.EntityReader nextReader = null;
>         if (fStillActive) {
>             nextReader = fEntityHandler.changeReaders();
>             fStillActive = false;
>        // Allow these following three fields to be GC-ed.
>             fEntityHandler = null;
>             fErrorReporter = null;
>             fCharDataHandler = null;
>         }
>         return nextReader;
>     }
>
> In StringReader.java:
>
>     public XMLEntityHandler.EntityReader changeReaders() throws Exception
{
>         XMLEntityHandler.EntityReader nextReader = super.changeReaders();
>         synchronized (StringReader.class) {
>             fNextFreeReader = fgFreeReaders;
>             fgFreeReaders = this;
>        // Allow these following two fields to be GC-ed.
>             fStringPool = null;
>           fData = null;
>         }
>         return nextReader;
>     }
>
> Regards,
> Glenn
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to