Jacek Caban : mshtml: Don't share nsrow reference with nsnode.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Sep 26 16:35:49 CDT 2014


Module: wine
Branch: master
Commit: 1e9f33924b3b7c10a02871e522126caca2de3e04
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=1e9f33924b3b7c10a02871e522126caca2de3e04

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Fri Sep 26 15:11:40 2014 +0200

mshtml: Don't share nsrow reference with nsnode.

---

 dlls/mshtml/htmltablerow.c | 38 +++++++++++++++++++++++++++++++++-----
 1 file changed, 33 insertions(+), 5 deletions(-)

diff --git a/dlls/mshtml/htmltablerow.c b/dlls/mshtml/htmltablerow.c
index 589a38f..a5da29f 100644
--- a/dlls/mshtml/htmltablerow.c
+++ b/dlls/mshtml/htmltablerow.c
@@ -402,13 +402,44 @@ static HRESULT HTMLTableRow_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
     return HTMLElement_QI(&This->element.node, riid, ppv);
 }
 
+static void HTMLTableRow_traverse(HTMLDOMNode *iface, nsCycleCollectionTraversalCallback *cb)
+{
+    HTMLTableRow *This = impl_from_HTMLDOMNode(iface);
+
+    if(This->nsrow)
+        note_cc_edge((nsISupports*)This->nsrow, "This->nstablerow", cb);
+}
+
+static void HTMLTableRow_unlink(HTMLDOMNode *iface)
+{
+    HTMLTableRow *This = impl_from_HTMLDOMNode(iface);
+
+    if(This->nsrow) {
+        nsIDOMHTMLTableRowElement *nsrow = This->nsrow;
+
+        This->nsrow = NULL;
+        nsIDOMHTMLTableRowElement_Release(nsrow);
+    }
+}
+
 static const NodeImplVtbl HTMLTableRowImplVtbl = {
     HTMLTableRow_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,
+    HTMLTableRow_traverse,
+    HTMLTableRow_unlink
 };
 
 static const tid_t HTMLTableRow_iface_tids[] = {
@@ -439,10 +470,7 @@ HRESULT HTMLTableRow_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HT
     HTMLElement_Init(&ret->element, doc, nselem, &HTMLTableRow_dispex);
 
     nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLTableRowElement, (void**)&ret->nsrow);
-
-    /* Share nsrow reference with nsnode */
-    assert(nsres == NS_OK && (nsIDOMNode*)ret->nsrow == ret->element.node.nsnode);
-    nsIDOMNode_Release(ret->element.node.nsnode);
+    assert(nsres == NS_OK);
 
     *elem = &ret->element;
     return S_OK;




More information about the wine-cvs mailing list