From 246dfc65ca22339a9092b07cd0af51a2ed9ac1f3 Mon Sep 17 00:00:00 2001 From: Andreas Haas Date: Mon, 10 Apr 2017 19:41:27 +0200 Subject: [PATCH] Fix crash on exit. First it crashed in the thread that checks for android devices, then in the audio driver. --- platform/android/export/export.cpp | 7 +++++++ servers/audio_server.cpp | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index 78c28ede506..72d665329e6 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -3532,6 +3532,13 @@ public: devices_changed = true; quit_request = false; } + + ~EditorExportAndroid() { + quit_request = true; + Thread::wait_to_finish(device_thread); + memdelete(device_lock); + memdelete(device_thread); + } }; void register_android_exporter() { diff --git a/servers/audio_server.cpp b/servers/audio_server.cpp index 1b1ed45862f..f3bba4ae90c 100644 --- a/servers/audio_server.cpp +++ b/servers/audio_server.cpp @@ -761,6 +761,10 @@ void AudioServer::finish() { } buses.clear(); + + if (AudioDriver::get_singleton()) { + AudioDriver::get_singleton()->finish(); + } } void AudioServer::update() { }