amstream: Keep stream reference when creating sample.

This commit is contained in:
Nikolay Sivov 2015-06-22 22:56:10 +03:00 committed by Alexandre Julliard
parent 139445eb49
commit 17283f9be5
1 changed files with 3 additions and 0 deletions

View File

@ -906,6 +906,7 @@ static ULONG WINAPI IDirectDrawStreamSampleImpl_Release(IDirectDrawStreamSample
{ {
if (This->surface) if (This->surface)
IDirectDrawSurface_Release(This->surface); IDirectDrawSurface_Release(This->surface);
IMediaStream_Release(This->parent);
HeapFree(GetProcessHeap(), 0, This); HeapFree(GetProcessHeap(), 0, This);
} }
@ -1011,6 +1012,8 @@ static HRESULT ddrawstreamsample_create(IDirectDrawMediaStream *parent, IDirectD
object->IDirectDrawStreamSample_iface.lpVtbl = &DirectDrawStreamSample_Vtbl; object->IDirectDrawStreamSample_iface.lpVtbl = &DirectDrawStreamSample_Vtbl;
object->ref = 1; object->ref = 1;
object->parent = (IMediaStream*)parent; object->parent = (IMediaStream*)parent;
IMediaStream_AddRef(object->parent);
if (surface) if (surface)
{ {
object->surface = surface; object->surface = surface;