mirror of
https://github.com/reactos/wine.git
synced 2024-11-24 20:30:01 +00:00
coreaudio: Make sure Port_SendToMessageThread is not NULL before calling CFMessagePortSendRequest.
Prevents crashing when closing audio device during playback.
This commit is contained in:
parent
031ee3e695
commit
686ea70c18
@ -349,6 +349,9 @@ static void wodSendNotifyCompletionsMessage(WINE_WAVEOUT* wwo)
|
||||
CFDataRef data;
|
||||
UInt32 buffer;
|
||||
|
||||
if (!Port_SendToMessageThread)
|
||||
return;
|
||||
|
||||
buffer = (UInt32) wwo->woID;
|
||||
|
||||
data = CFDataCreate(kCFAllocatorDefault, (UInt8 *)&buffer, sizeof(buffer));
|
||||
@ -368,6 +371,9 @@ static void wodSendNotifyInputCompletionsMessage(WINE_WAVEIN* wwi)
|
||||
CFDataRef data;
|
||||
UInt32 buffer;
|
||||
|
||||
if (!Port_SendToMessageThread)
|
||||
return;
|
||||
|
||||
buffer = (UInt32) wwi->wiID;
|
||||
|
||||
data = CFDataCreate(kCFAllocatorDefault, (UInt8 *)&buffer, sizeof(buffer));
|
||||
@ -694,6 +700,9 @@ void CoreAudio_WaveRelease(void)
|
||||
/* Stop CFRunLoop in messageThread */
|
||||
TRACE("()\n");
|
||||
|
||||
if (!Port_SendToMessageThread)
|
||||
return;
|
||||
|
||||
CFMessagePortSendRequest(Port_SendToMessageThread, kStopLoopMessage, NULL, 0.0, 0.0, NULL, NULL);
|
||||
CFRelease(Port_SendToMessageThread);
|
||||
Port_SendToMessageThread = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user