Jacek Caban : mshtml: Call HTMLDOMNode_Init directly in HTMLCommentElement_Create.

Alexandre Julliard julliard at winehq.org
Tue Jun 26 13:34:14 CDT 2012


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Tue Jun 26 12:34:21 2012 +0200

mshtml: Call HTMLDOMNode_Init directly in HTMLCommentElement_Create.

---

 dlls/mshtml/htmlcomment.c |    4 +---
 dlls/mshtml/htmlelem.c    |    3 ++-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/dlls/mshtml/htmlcomment.c b/dlls/mshtml/htmlcomment.c
index 525f0db..d552b30 100644
--- a/dlls/mshtml/htmlcomment.c
+++ b/dlls/mshtml/htmlcomment.c
@@ -200,9 +200,7 @@ HRESULT HTMLCommentElement_Create(HTMLDocumentNode *doc, nsIDOMNode *nsnode, HTM
     ret->IHTMLCommentElement_iface.lpVtbl = &HTMLCommentElementVtbl;
 
     HTMLElement_Init(&ret->element, doc, NULL, &HTMLCommentElement_dispex);
-
-    nsIDOMNode_AddRef(nsnode);
-    ret->element.node.nsnode = nsnode;
+    HTMLDOMNode_Init(doc, &ret->element.node, nsnode);
 
     *elem = &ret->element;
     return S_OK;
diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c
index 10d5108..7ab1856 100644
--- a/dlls/mshtml/htmlelem.c
+++ b/dlls/mshtml/htmlelem.c
@@ -1776,7 +1776,8 @@ void HTMLElement_Init(HTMLElement *This, HTMLDocumentNode *doc, nsIDOMHTMLElemen
         nsIDOMHTMLElement_AddRef(nselem);
     This->nselem = nselem;
 
-    HTMLDOMNode_Init(doc, &This->node, (nsIDOMNode*)nselem);
+    if(nselem)
+        HTMLDOMNode_Init(doc, &This->node, (nsIDOMNode*)nselem);
 
     ConnectionPointContainer_Init(&This->cp_container, (IUnknown*)&This->IHTMLElement_iface);
 }




More information about the wine-cvs mailing list