strmbase: Release the allocator in IPin::Disconnect() (Valgrind).

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
feature/deterministic
Zebediah Figura 2020-06-08 18:59:41 -05:00 committed by Alexandre Julliard
parent 7ac949a101
commit 05f319a394
3 changed files with 15 additions and 2 deletions

View File

@ -1443,7 +1443,7 @@ static void test_connect_pin(void)
ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#x.\n", hr);
ref = IMemAllocator_Release(allocator);
todo_wine ok(!ref, "Got outstanding refcount %d.\n", ref);
ok(!ref, "Got outstanding refcount %d.\n", ref);
IMemInputPin_Release(input);
IPin_Release(pin);
ref = IFilterGraph2_Release(graph);

View File

@ -3072,7 +3072,7 @@ static void test_renderless_formats(void)
ok(hr == S_OK, "Test %u: Got hr %#x.\n", i, hr);
hr = IMemInputPin_GetAllocator(input, &allocator);
todo_wine_if (i == 0) ok(hr == S_OK, "Test %u: Got hr %#x.\n", i, hr);
todo_wine ok(hr == S_OK, "Test %u: Got hr %#x.\n", i, hr);
if (hr != S_OK)
{
test_allocator(input);

View File

@ -594,6 +594,13 @@ static HRESULT WINAPI source_Disconnect(IPin *iface)
IMemInputPin_Release(This->pMemInputPin);
This->pMemInputPin = NULL;
}
if (This->pAllocator)
{
IMemAllocator_Release(This->pAllocator);
This->pAllocator = NULL;
}
if (This->pin.peer)
{
IPin_Release(This->pin.peer);
@ -930,6 +937,12 @@ static HRESULT WINAPI sink_Disconnect(IPin *iface)
if (pin->pFuncsTable->sink_disconnect)
pin->pFuncsTable->sink_disconnect(pin);
if (pin->pAllocator)
{
IMemAllocator_Release(pin->pAllocator);
pin->pAllocator = NULL;
}
IPin_Release(pin->pin.peer);
pin->pin.peer = NULL;
FreeMediaType(&pin->pin.mt);