evr/sample: Use explicit critical section for release handling.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2022-05-10 19:16:18 +03:00 committed by Alexandre Julliard
parent ce71f5a05f
commit d686663d22
1 changed files with 2 additions and 2 deletions

View File

@ -923,7 +923,7 @@ static ULONG WINAPI video_sample_Release(IMFSample *iface)
ULONG refcount = InterlockedDecrement(&sample->refcount);
IMFAsyncResult *tracked_result = NULL;
IMFSample_LockStore(sample->sample);
EnterCriticalSection(&sample->cs);
if (sample->tracked_result && sample->tracked_refcount == refcount)
{
tracked_result = sample->tracked_result;
@ -931,7 +931,7 @@ static ULONG WINAPI video_sample_Release(IMFSample *iface)
sample->tracked_result = NULL;
sample->tracked_refcount = 0;
}
IMFSample_UnlockStore(sample->sample);
LeaveCriticalSection(&sample->cs);
if (tracked_result)
IMFAsyncResult_Release(tracked_result);