Break cycle-through-XPCOM by adding an assignment to null when done with |iterator|. b=285065 r+sr=bryner
This commit is contained in:
Родитель
d8fd9ea457
Коммит
37eaa019d7
|
@ -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>
|
||||
|
|
Загрузка…
Ссылка в новой задаче