mshtml: Don't share nsoption reference with nsnode.

This commit is contained in:
Jacek Caban 2014-09-25 12:11:19 +02:00 committed by Alexandre Julliard
parent cac39acbe3
commit 01e09bbb47
1 changed files with 33 additions and 5 deletions

View File

@ -311,13 +311,44 @@ static HRESULT HTMLOptionElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
return HTMLElement_QI(&This->element.node, riid, ppv);
}
static void HTMLOptionElement_traverse(HTMLDOMNode *iface, nsCycleCollectionTraversalCallback *cb)
{
HTMLOptionElement *This = impl_from_HTMLDOMNode(iface);
if(This->nsoption)
note_cc_edge((nsISupports*)This->nsoption, "This->nsoption", cb);
}
static void HTMLOptionElement_unlink(HTMLDOMNode *iface)
{
HTMLOptionElement *This = impl_from_HTMLDOMNode(iface);
if(This->nsoption) {
nsIDOMHTMLOptionElement *nsoption = This->nsoption;
This->nsoption = NULL;
nsIDOMHTMLOptionElement_Release(nsoption);
}
}
static const NodeImplVtbl HTMLOptionElementImplVtbl = {
HTMLOptionElement_QI,
HTMLElement_destructor,
HTMLElement_cpc,
HTMLElement_clone,
HTMLElement_handle_event,
HTMLElement_get_attr_col
HTMLElement_get_attr_col,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
HTMLOptionElement_traverse,
HTMLOptionElement_unlink
};
static const tid_t HTMLOptionElement_iface_tids[] = {
@ -347,10 +378,7 @@ HRESULT HTMLOptionElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nsele
HTMLElement_Init(&ret->element, doc, nselem, &HTMLOptionElement_dispex);
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLOptionElement, (void**)&ret->nsoption);
/* Share nsoption reference with nsnode */
assert(nsres == NS_OK && (nsIDOMNode*)ret->nsoption == ret->element.node.nsnode);
nsIDOMNode_Release(ret->element.node.nsnode);
assert(nsres == NS_OK);
*elem = &ret->element;
return S_OK;