Jacek Caban (@jacek) commented about dlls/mshtml/htmlwindow.c:
if(doc) detach_document_node(doc);
- if(outer_window && outer_window->location)
dispex_unlink(&outer_window->location->dispex);
There is still a similar problem with location's function objects (although it's more generic: we should probably generally traverse and unlink them).