Break cycle-through-XPCOM by adding an assignment to null when done with |iterator|. b=285065 r+sr=bryner

This commit is contained in:
dbaron%dbaron.org 2005-03-07 04:36:44 +00:00
Родитель d8fd9ea457
Коммит 37eaa019d7
2 изменённых файлов: 11 добавлений и 0 удалений

Просмотреть файл

@ -221,6 +221,11 @@
while (iterator.nextNode())
radioChildren.push(iterator.currentNode);
// assign null to break circular reference between _filterRadioGroup
// and iterator (via this scope)
// XXX The function really should be global instead of local.
iterator = null;
return this.mRadioChildren = radioChildren;
]]>
</body>

Просмотреть файл

@ -220,6 +220,12 @@
var iterator = this.ownerDocument.createTreeWalker(this, NodeFilter.SHOW_ELEMENT, _filterRadioGroup, true);
while (iterator.nextNode())
radioChildren.push(iterator.currentNode);
// assign null to break circular reference between _filterRadioGroup
// and iterator (via this scope)
// XXX The function really should be global instead of local.
iterator = null;
return this.mRadioChildren = radioChildren;
]]>
</body>