Commit 2e726e6e authored by Chris Robinson's avatar Chris Robinson Committed by Alexandre Julliard

quartz: Avoid asserting from used samples on allocator release.

parent 809f6842
...@@ -490,7 +490,10 @@ static ULONG WINAPI StdMediaSample2_Release(IMediaSample2 * iface) ...@@ -490,7 +490,10 @@ static ULONG WINAPI StdMediaSample2_Release(IMediaSample2 * iface)
if (!ref) if (!ref)
{ {
IMemAllocator_ReleaseBuffer(This->pParent, (IMediaSample *)iface); if (This->pParent)
IMemAllocator_ReleaseBuffer(This->pParent, (IMediaSample *)iface);
else
StdMediaSample2_Delete(This);
return 0; return 0;
} }
return ref; return ref;
...@@ -813,7 +816,17 @@ static HRESULT StdMemAllocator_Free(IMemAllocator * iface) ...@@ -813,7 +816,17 @@ static HRESULT StdMemAllocator_Free(IMemAllocator * iface)
StdMemAllocator *This = (StdMemAllocator *)iface; StdMemAllocator *This = (StdMemAllocator *)iface;
struct list * cursor; struct list * cursor;
assert(list_empty(&This->base.used_list)); if (!list_empty(&This->base.used_list))
{
WARN("Freeing allocator with outstanding samples!\n");
while ((cursor = list_head(&This->base.used_list)) != NULL)
{
StdMediaSample2 *pSample;
list_remove(cursor);
pSample = LIST_ENTRY(cursor, StdMediaSample2, listentry);
pSample->pParent = NULL;
}
}
while ((cursor = list_head(&This->base.free_list)) != NULL) while ((cursor = list_head(&This->base.free_list)) != NULL)
{ {
......
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