From 8c396ed437eb907a2251d5120e50243f3e6c72de Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Tue, 26 Jun 2012 12:34:21 +0200 Subject: [PATCH] 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 525f0dbf7f7..d552b30d1bb 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 10d5108aee2..7ab18562b62 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); }