Commit 23fc0dc8 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Don't share nsimg reference with nsnode.

parent 268b22e5
......@@ -686,6 +686,26 @@ static HRESULT HTMLImgElement_get_readystate(HTMLDOMNode *iface, BSTR *p)
return IHTMLImgElement_get_readyState(&This->IHTMLImgElement_iface, p);
}
static void HTMLImgElement_traverse(HTMLDOMNode *iface, nsCycleCollectionTraversalCallback *cb)
{
HTMLImgElement *This = impl_from_HTMLDOMNode(iface);
if(This->nsimg)
note_cc_edge((nsISupports*)This->nsimg, "This->nsimg", cb);
}
static void HTMLImgElement_unlink(HTMLDOMNode *iface)
{
HTMLImgElement *This = impl_from_HTMLDOMNode(iface);
if(This->nsimg) {
nsIDOMHTMLImageElement *nsimg = This->nsimg;
This->nsimg = NULL;
nsIDOMHTMLImageElement_Release(nsimg);
}
}
static const NodeImplVtbl HTMLImgElementImplVtbl = {
HTMLImgElement_QI,
HTMLElement_destructor,
......@@ -698,7 +718,12 @@ static const NodeImplVtbl HTMLImgElementImplVtbl = {
NULL,
NULL,
NULL,
HTMLImgElement_get_readystate
HTMLImgElement_get_readystate,
NULL,
NULL,
NULL,
HTMLImgElement_traverse,
HTMLImgElement_unlink
};
static const tid_t HTMLImgElement_iface_tids[] = {
......@@ -728,10 +753,7 @@ HRESULT HTMLImgElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem,
HTMLElement_Init(&ret->element, doc, nselem, &HTMLImgElement_dispex);
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLImageElement, (void**)&ret->nsimg);
/* Share nsimg reference with nsnode */
assert(nsres == NS_OK && (nsIDOMNode*)ret->nsimg == ret->element.node.nsnode);
nsIDOMNode_Release(ret->element.node.nsnode);
assert(nsres == NS_OK);
*elem = &ret->element;
return S_OK;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment