Improved robustness of object destruction

Some objects create new objects in their destructor; thus
several passes might be necessary to get rid of all referenced
objects.