Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

Web: Dont wait for audio thread to finish if it never started

Mariano Suligoyd37c06132355
diff --git a/platform/web/audio_driver_web.cpp b/platform/web/audio_driver_web.cpp
index 887b46fbe15..38e083fa821 100644
--- a/platform/web/audio_driver_web.cpp
+++ b/platform/web/audio_driver_web.cpp
@@ -446,8 +446,10 @@ void AudioDriverWorklet::unlock() {
}
void AudioDriverWorklet::finish_driver() {
- quit = true; // Ask thread to quit.
- thread.wait_to_finish();
+ if (thread.is_started()) {
+ quit = true; // Ask thread to quit.
+ thread.wait_to_finish();
+ }
}
#else // No threads.