1
0
mirror of https://github.com/wine-mirror/wine synced 2024-07-08 03:45:57 +00:00

winegstreamer: Leave media source critical section before unlocking workqueue.

Today, if media_source_Shutdown is called around the same time
as a work item is put on the async_commands_queue, we end up in
a deadlock if Shutdown enters media source's cs first, as it
waits for the queue's callback to finish, which, in turn,
waits for the object's cs to be released.

To avoid this leave the cs, before unlocking the workqueue,
to let any callback on the queue finish running.

Signed-off-by: Bernhard Kölbl <bkoelbl@codeweavers.com>
This commit is contained in:
Bernhard Kölbl 2023-08-02 21:05:30 +02:00 committed by Alexandre Julliard
parent 35cff9ec6e
commit ef1b964826

View File

@ -1570,10 +1570,10 @@ static HRESULT WINAPI media_source_Shutdown(IMFMediaSource *iface)
free(source->descriptors);
free(source->streams);
MFUnlockWorkQueue(source->async_commands_queue);
LeaveCriticalSection(&source->cs);
MFUnlockWorkQueue(source->async_commands_queue);
return S_OK;
}