Closed Bug 649163 Opened 9 years ago Closed 9 years ago

nsDOMCSSDeclaration::GetCSSParsingEnvironment should not AddRef its output

Categories

(Core :: CSS Parsing and Computation, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla6

People

(Reporter: dbaron, Assigned: bzbarsky)

Details

Attachments

(1 file, 1 obsolete file)

Filed per request in bug 435442 comment 37:

nsDOMCSSDeclaration::GetCSSParsingEnvironment (a pure virtual function) and its implementations currently AddRef all the out-parameters.  However, this is probably unnecessary, and it should be changed to fill in weak pointers.
Priority: -- → P1
Whiteboard: [need review]
Comment on attachment 528613 [details] [diff] [review]
Stop refcounting the return values from GetCSSParsingEnvironment, where possible.

>@@ -120,17 +120,17 @@ nsDOMCSSAttributeDeclaration::DocToUpdat
>...
>   // We need GetOwnerDoc() rather than GetCurrentDoc() because it might
>   // be the BeginUpdate call that inserts mElement into the document.
>-  return mElement->GetOwnerDoc();
>+  return mElement->GetCurrentDoc();
> }

Were you just experimenting with something here?  I'm guessing this
wasn't intended to be part of the patch.  If it was, please explain.

r=dbaron assuming that wasn't supposed to be here
Attachment #528613 - Flags: review?(dbaron) → review+
> Were you just experimenting with something here?

Yes.  I was sure I'd reverted that change, but clearly not.  Thank you for catching it!

Reverted locally.
Whiteboard: [need review] → [need landing]
Attachment #528613 - Attachment is obsolete: true
This was pushed as http://hg.mozilla.org/mozilla-central/rev/27987cc4f4bb
Status: NEW → RESOLVED
Closed: 9 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Whiteboard: [need landing]
Target Milestone: --- → mozilla6
You need to log in before you can comment on or make changes to this bug.