Closed
Bug 502055
Opened 15 years ago
Closed 15 years ago
XBL leaks
Categories
(Core :: XBL, defect)
Core
XBL
Tracking
()
RESOLVED
FIXED
mozilla1.9.2a1
People
(Reporter: peterv, Assigned: peterv)
References
Details
Attachments
(1 file, 1 obsolete file)
2.33 KB,
patch
|
smaug
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
If an element with a binding doesn't have a parent, we won't unlink it because we currently rely on a parent to do that by calling Unbind on its children.
If an element with a binding doesn't have an owner document anymore, we won't unlink it because we can't get at the binding from the element.
Comment 1•15 years ago
|
||
Comment on attachment 386585 [details] [diff] [review]
v1
>diff --git a/content/base/src/nsGenericElement.cpp b/content/base/src/nsGenericElement.cpp
>--- a/content/base/src/nsGenericElement.cpp
>+++ b/content/base/src/nsGenericElement.cpp
>@@ -3987,8 +3987,17 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(ns
> NS_IF_RELEASE(slots->mControllers);
> slots->mChildrenList = nsnull;
> }
> }
>+
>+ {
>+ nsIDocument *doc;
>+ if (!tmp->GetNodeParent() && (doc = tmp->GetOwnerDoc()) &&
>+ tmp->HasFlag(NODE_MAY_BE_IN_BINDING_MNGR)) {
>+ nsAutoScriptBlocker scriptBlocker;
>+ doc->BindingManager()->ChangeDocumentFor(tmp, doc, nsnull);
>+ }
>+ }
> NS_IMPL_CYCLE_COLLECTION_UNLINK_END
Scriptblocker in unlink? Very scary. Does ChangeDocumentFor really need it?
Comment 2•15 years ago
|
||
Perhaps the scriptblocker could be set before calling cycle collector?
Assignee | ||
Comment 3•15 years ago
|
||
Yeah, I don't think it needs a script blocker.
Attachment #386585 -
Attachment is obsolete: true
Attachment #386746 -
Flags: superreview?(bzbarsky)
Attachment #386746 -
Flags: review?(Olli.Pettay)
Updated•15 years ago
|
Attachment #386746 -
Flags: superreview?(bzbarsky) → superreview+
Comment 4•15 years ago
|
||
Comment on attachment 386746 [details] [diff] [review]
v1.1
Looks ok. Does this fix those addBinding leaks we were seeing on mochitest, perchance?
Updated•15 years ago
|
Attachment #386746 -
Flags: review?(Olli.Pettay) → review+
Assignee | ||
Comment 5•15 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/fe1f520ff772
I'll try to make a testcase, but it could be hard (dependent on order of CC or GC).
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Flags: in-testsuite?
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.2a1
You need to log in
before you can comment on or make changes to this bug.
Description
•