On Jan 24, 4:46 pm, "Jonathan Rosenberg" <j...@tabbysplace.org> wrote:
[...]
> Ahhh ... so now you're starting to answer my original question: "How does js 
> do garbage collection?"  It's not as simple as it
> appears (at least, to me).
>
> So, can I assume that the naked "new Ajax.Request" object will be marked as 
> garbage once it's done its job?  Or is this up to each
> interpreter?  If so, it would seem to be good practice to hold a ref to the 
> object & set to null once it's served its purpose.

I would assume that "naked" `new Ajax.Request` is garbage collected as
soon as it no longer needs to respond to events (i.e. when server
response is completed and all callbacks, if any, are executed).
Doesn't this behavior looks logical? If GC was allowed to collect
objects that have asynchronous callbacks as their properties, the
integrity of a program would be compromised and there wouldn't be much
use in this asynchronous behavior at all. If don't recall any client
that would behave in such way.

--
kangax
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to