xmllite: Don't release reader input reference on failure, as newer versions do.
This commit is contained in:
parent
07e2730c0e
commit
5864234051
|
@ -103,11 +103,8 @@ static ULONG WINAPI xmlreader_Release(IXmlReader *iface)
|
|||
ref = InterlockedDecrement(&This->ref);
|
||||
if (ref == 0)
|
||||
{
|
||||
if (This->input)
|
||||
{
|
||||
IUnknown_Release(This->stream);
|
||||
IUnknown_Release(This->input);
|
||||
}
|
||||
if (This->input) IUnknown_Release(This->input);
|
||||
if (This->stream) IUnknown_Release(This->stream);
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
}
|
||||
|
||||
|
@ -154,13 +151,7 @@ static HRESULT WINAPI xmlreader_SetInput(IXmlReader* iface, IUnknown *input)
|
|||
|
||||
/* set stream for supplied IXmlReaderInput */
|
||||
hr = xmlreaderinput_query_for_stream(This->input, (void**)&This->stream);
|
||||
if (hr != S_OK)
|
||||
{
|
||||
/* IXmlReaderInput doesn't provide streaming interface */
|
||||
IUnknown_Release(This->input);
|
||||
This->input = NULL;
|
||||
}
|
||||
else
|
||||
if (hr == S_OK)
|
||||
This->state = XmlReadState_Initial;
|
||||
|
||||
return hr;
|
||||
|
|
|
@ -439,6 +439,7 @@ static void test_readerinput(void)
|
|||
ok(ref == 3, "Expected 3, got %d\n", ref);
|
||||
IUnknown_Release(reader_input);
|
||||
|
||||
IUnknown_Release(reader_input);
|
||||
IUnknown_Release(reader_input);
|
||||
IStream_Release(stream);
|
||||
|
||||
|
@ -479,7 +480,8 @@ static void test_readerinput(void)
|
|||
IUnknown_Release(input);
|
||||
|
||||
ref = IUnknown_AddRef(reader_input);
|
||||
ok(ref == 2, "Expected 2, got %d\n", ref);
|
||||
ok(ref == 3 || broken(ref == 2) /* versions 1.0.x and 1.1.x - XP, Vista */,
|
||||
"Expected 3, got %d\n", ref);
|
||||
IUnknown_Release(reader_input);
|
||||
/* repeat another time, no check or caching here */
|
||||
input_iids.count = 0;
|
||||
|
|
Loading…
Reference in New Issue