winegstreamer: Fix reference leaks.

Andrew Eikum aeikum at codeweavers.com
Mon Dec 5 08:41:04 CST 2016


Signed-off-by: Andrew Eikum <aeikum at codeweavers.com>

On Mon, Dec 05, 2016 at 12:37:14AM +0900, Akihiro Sagawa wrote:
> 
> This fixes Bug #41870.
> 
> Signed-off-by: Akihiro Sagawa <sagawa.aki at gmail.com>
> ---
>  dlls/quartz/tests/filtergraph.c | 7 +++++++
>  dlls/winegstreamer/gstdemux.c   | 4 ++++
>  2 files changed, 11 insertions(+)
> 

> diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c
> index 3077b38..9db1c72 100644
> --- a/dlls/quartz/tests/filtergraph.c
> +++ b/dlls/quartz/tests/filtergraph.c
> @@ -366,6 +366,13 @@ static void test_render_run(const WCHAR *file)
>      }
>  
>      releasefiltergraph();
> +
> +    if (h != INVALID_HANDLE_VALUE) {
> +        /* check reference leaks */
> +        h = CreateFileW(file, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
> +        ok(h != INVALID_HANDLE_VALUE, "CreateFile failed: err=%d\n", GetLastError());
> +        CloseHandle(h);
> +    }
>  }
>  
>  static void test_graph_builder(void)
> diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c
> index 03d8d5b..c33ed9e 100644
> --- a/dlls/winegstreamer/gstdemux.c
> +++ b/dlls/winegstreamer/gstdemux.c
> @@ -1951,6 +1951,9 @@ static ULONG WINAPI GSTInPin_Release(IPin *iface)
>          if (This->pAlloc)
>              IMemAllocator_Release(This->pAlloc);
>          This->pAlloc = NULL;
> +        if (This->pReader)
> +            IAsyncReader_Release(This->pReader);
> +        This->pReader = NULL;
>          This->pin.IPin_iface.lpVtbl = NULL;
>          return 0;
>      } else
> @@ -2048,6 +2051,7 @@ static HRESULT WINAPI GSTInPin_Disconnect(IPin *iface)
>          if (SUCCEEDED(hr) && state == State_Stopped) {
>              IMemAllocator_Decommit(This->pAlloc);
>              IPin_Disconnect(This->pin.pConnectedTo);
> +            IPin_Release(This->pin.pConnectedTo);
>              This->pin.pConnectedTo = NULL;
>              hr = GST_RemoveOutputPins(Parser);
>          } else

> 




More information about the wine-patches mailing list