FWIW, it's the svn from ~3/1.  However, after more digging, it appears to be
a firefox bug. It works fine in 2.0.0.2, but I'm testing against
1.5.0.8since that's what my customers are using
FF1.5 and 1.5.0.8 doesn't have the DOM synchronization bug of 1.5.0.9 and
1.5.0.10.

It looks like on FF 1.5 XMLHttpRequest keeps holding a reference to any
function assigned to onreadystatechange. Setting onreadychange to null has
no effect, since it's already been cleared when readyState == 4.

I'm currently looking for a work around, but no real success so far. I'm
going to run some regression tests and see if I can limit the range of
browser versions I need to handle. Hopefully It's only a few releases
of 1.5that have this bug.


On 3/13/07, Bob Ippolito <[EMAIL PROTECTED]> wrote:
>
>
> On 3/13/07, Devon Miller <[EMAIL PROTECTED]> wrote:
> > I've found what looks like a memory leak in Async.SendXMLHttpRequest.
> Here's
> > the trail I'm following:
> >
> > req (1st param to SendXMLHttyRequest) is an instance of whatever object
> is
> > supplying XMLHttpRequest functionality
> >
> > d (local var to SendXMLHttyRequest) is set to
> > Base.partial(Async._xhr_canceller, req)
> >
> > So we have
> >         req
> >
> > and
> >         d = anonfunc1
> > .im_func = Async._xhr_canceller
> >         anonfunc1.im_preargs [0] = req;
> >
> > Finally, req.onreadystatechange is set to
> > Base.bind(Async._xhr_onreadystatechange, req, d) giving us:
> >
> >     req.onreadystatechange = anonfunc
> >     req.onreadystatechange.im_func = Async._xhr_onreadystatechange
> >     req.onreadystatechange.im_preargs[0] = d
> >     req.onreadystatechange.im_self = req
> >
> > The last value is where I believe the leak occurs, because that results
> in
> > this loop:
> >     req.onreadystatechange.im_preargs
> > [0].anonfunc.im_preargs[0] = req
> >
> > When Async._xhr_canceller or Async._xhr_onreadystatechange are called,
> they
> > set req.onreadystatechange to null. Leaving this:
> >     anonfunc
> > However, I cannot find anywhere that this loop is broken if the request
> > succeeds. The leak detector extension (
> > http://dbaron.org/mozilla/leak-monitor/) seems to back this
> > up as I get 1 reported leak for every XMLHttpRequest I make.
>
> I don't know what version of MochiKit you're looking at, but I can't
> reproduce this leak with svn trunk and it definitely does set
> this.onreadystatechange = null on success.
>
> -bob
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to