Commit 05f319a3 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

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

parent 7ac949a1
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment