mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-06 14:43:20 +00:00
wasapi: Don't ignore device disconnect events on unopened devices.
Reference Issue #13317.
This commit is contained in:
parent
2f41dd7b5c
commit
b9c790949e
1 changed files with 1 additions and 1 deletions
|
|
@ -347,7 +347,7 @@ static void WASAPI_DetectDevices(SDL_AudioDevice **default_playback, SDL_AudioDe
|
|||
void WASAPI_DisconnectDevice(SDL_AudioDevice *device)
|
||||
{
|
||||
// don't block in here; IMMDevice's own thread needs to return or everything will deadlock.
|
||||
if (device && device->hidden && SDL_CompareAndSwapAtomicInt(&device->hidden->device_disconnecting, 0, 1)) {
|
||||
if (device && (!device->hidden || SDL_CompareAndSwapAtomicInt(&device->hidden->device_disconnecting, 0, 1))) {
|
||||
SDL_AudioDeviceDisconnected(device); // this proxies the work to the main thread now, so no point in proxying to the management thread.
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue