mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-22 00:06:59 +02:00
Fix a crash when uninitializing a device in single-threaded mode.
This commit is contained in:
+3
-4
@@ -45400,16 +45400,15 @@ MA_API void ma_device_uninit(ma_device* pDevice)
|
||||
need to wait for the operation to complete. We can just wait for the thread instead.
|
||||
*/
|
||||
#ifndef MA_NO_THREADING
|
||||
{
|
||||
if (pDevice->hasAudioThread) {
|
||||
ma_device_op_queue_push(&pDevice->opQueue, MA_DEVICE_OP_UNINIT, NULL, NULL);
|
||||
ma_thread_wait(&pDevice->audioThread);
|
||||
}
|
||||
#else
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
/* Not using threading. */
|
||||
ma_device_op_do_uninit(pDevice, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (pDevice->type == ma_device_type_duplex) {
|
||||
ma_duplex_rb_uninit(&pDevice->duplexRB);
|
||||
|
||||
Reference in New Issue
Block a user