my_var = null; and delete my_var; should do exactly the same
thing...delete doesn't actually delete the object, only the reference
to the object. it doesn't get removed from memory until later
(when the GC feels like it)

Well, technically they do *slightly* different things, but usually with almost the same end result. Delete destroys the reference, allowing the object to be cleaned up by the GC (assuming there are no other references to it), and assigning null to the reference reassigns the reference to a different object, so your original object will be cleaned up by the GC, however, the reference will still exist, it just points to null. Delete actually dumps both the object and the reference (eventually, when the GC gets around to it), while assigning null only dumps the object (again, when the GC gets to it).

ryanm
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to