mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-22 00:06:59 +02:00
Fix a crash when uninitialising a device without stopping it first.
This commit is contained in:
@@ -40902,6 +40902,11 @@ static ma_thread_result MA_THREADCALL ma_worker_thread(void* pData)
|
|||||||
ma_device__on_notification_stopped(pDevice);
|
ma_device__on_notification_stopped(pDevice);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If we stopped because the device has been uninitialized, abort now. */
|
||||||
|
if (ma_device_get_state(pDevice) == ma_device_state_uninitialized) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* A function somewhere is waiting for the device to have stopped for real so we need to signal an event to allow it to continue. */
|
/* A function somewhere is waiting for the device to have stopped for real so we need to signal an event to allow it to continue. */
|
||||||
ma_device__set_state(pDevice, ma_device_state_stopped);
|
ma_device__set_state(pDevice, ma_device_state_stopped);
|
||||||
ma_event_signal(&pDevice->stopEvent);
|
ma_event_signal(&pDevice->stopEvent);
|
||||||
|
|||||||
Reference in New Issue
Block a user