2D Context needs to not hold pointer after Release

RESOLVED FIXED

Status

()

Core
Canvas: 2D
RESOLVED FIXED
13 years ago
12 years ago

People

(Reporter: vlad, Unassigned)

Tracking

Trunk
x86
All
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Right now, CanvasRenderingContext2D does this:

    mDOMCanvasElement = aCanvasElement;
    if (mDOMCanvasElement) {
        if (NS_SUCCEEDED (CallQueryInterface(mDOMCanvasElement, &mCanvasElement)
)) {
            // don't hold a ref to this!
            mCanvasElement->Release();
        }
    } else {
        mCanvasElement = nsnull;
    }

to have "weak" refs to both the nsIDOMHTMLCanvasElement and nsICanvasElement
interfaces.  The method should take both as params, instead of doing
CallQI/Release().
Why do you need mDOMCanvasElement at all? Just QI to nsIDOMHTMLCanvasElement in
the few places you need it and remove the member.
Patch for this in bug 293267's speedup patch.
Checked in with 293267.
Status: NEW → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.