msxml: It's valid to release an empty document.

This commit is contained in:
Huw Davies 2006-01-10 19:58:42 +01:00 committed by Alexandre Julliard
parent 1b9fc2a170
commit a48bb7b3de
2 changed files with 9 additions and 2 deletions

View File

@ -743,8 +743,8 @@ static ULONG WINAPI Internal_Release(
ref = InterlockedDecrement( &This->ref );
if ( ref == 0 )
{
assert( This->node->doc );
xmldoc_release( This->node->doc );
if( This->node )
xmldoc_release( This->node->doc );
HeapFree( GetProcessHeap(), 0, This );
}

View File

@ -513,6 +513,13 @@ static void test_refs(void)
LONG ref;
IUnknown *unk, *unk2;
r = CoCreateInstance( &CLSID_DOMDocument, NULL,
CLSCTX_INPROC_SERVER, &IID_IXMLDOMDocument, (LPVOID*)&doc );
if( r != S_OK )
return;
ref = IXMLDOMDocument_Release(doc);
ok( ref == 0, "ref %ld\n", ref);
r = CoCreateInstance( &CLSID_DOMDocument, NULL,
CLSCTX_INPROC_SERVER, &IID_IXMLDOMDocument, (LPVOID*)&doc );
if( r != S_OK )