Browse Source

Fix crash on exit.

First it crashed in the thread that checks for android devices, then in the audio driver.
Andreas Haas 8 years ago
parent
commit
246dfc65ca
2 changed files with 11 additions and 0 deletions
  1. 7 0
      platform/android/export/export.cpp
  2. 4 0
      servers/audio_server.cpp

+ 7 - 0
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() {

+ 4 - 0
servers/audio_server.cpp

@@ -761,6 +761,10 @@ void AudioServer::finish() {
 	}
 
 	buses.clear();
+
+	if (AudioDriver::get_singleton()) {
+		AudioDriver::get_singleton()->finish();
+	}
 }
 void AudioServer::update() {
 }