I am currently rethinking the object dispose handling of the qooxdoo JavaScript framework.
Have a look at the following diagram (A is currently in scope):
diagram http://yuml.me/51747906.jpg
Let's say we want to delete B. Generally, we cut all reference between all objects. This means we cut connection 1 to 5 in the example. Is this really necessary?
As far as I have read here, browsers use the mark-and-sweep algorithm. In that case, we just need to cut reference 1 (connection to the scope) and 5 (connection to the DOM) which could be much faster.
But can I be sure that all browsers use the mark-and-sweep algorithm or something similar?