From cb52019ea0c33e1ac188f5132cd4a11fbd46f0a4 Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Thu, 11 Aug 2005 10:58:11 +0000 Subject: [PATCH] Increment the document's refcount when creating the root element. --- dlls/msxml3/domdoc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dlls/msxml3/domdoc.c b/dlls/msxml3/domdoc.c index 4fdb589ef3c..23714fd08e8 100644 --- a/dlls/msxml3/domdoc.c +++ b/dlls/msxml3/domdoc.c @@ -503,6 +503,7 @@ static HRESULT WINAPI domdoc_get_documentElement( domdoc *This = impl_from_IXMLDOMDocument( iface ); xmlDocPtr xmldoc = NULL; xmlNodePtr root = NULL; + IXMLDOMElement* element; TRACE("%p\n", This); @@ -519,7 +520,12 @@ static HRESULT WINAPI domdoc_get_documentElement( if ( !root ) return S_FALSE; - *DOMElement = create_element( root ); + element = create_element( root ); + if ( element ) + { + IXMLDOMNode_AddRef( This->node ); + *DOMElement = element; + } return S_OK; }