Closed Bug 293544 Opened 19 years ago Closed 19 years ago

2D Context needs to not hold pointer after Release

Categories

(Core :: Graphics: Canvas2D, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: vlad, Unassigned)

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
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.