summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcelo Fernandez <marcelofg55@gmail.com>2017-08-01 18:09:52 -0300
committerMarcelo Fernandez <marcelofg55@gmail.com>2017-08-01 18:09:52 -0300
commit3180827387f3a0f240f911227fd42d93bb4c9b13 (patch)
tree6ce05b14e3e8d64ba5cb760cee795fff9cca93e8
parent6dd1cdc9dbc0fbcdc0a1484906f4ef25610c4c20 (diff)
Fix AudioServer::finish not getting called while quitting
-rw-r--r--main/main.cpp1
-rw-r--r--servers/audio_server.cpp3
2 files changed, 3 insertions, 1 deletions
diff --git a/main/main.cpp b/main/main.cpp
index 8960d85c45..ed6ed019f4 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -1704,6 +1704,7 @@ void Main::cleanup() {
#endif
if (audio_server) {
+ audio_server->finish();
memdelete(audio_server);
}
diff --git a/servers/audio_server.cpp b/servers/audio_server.cpp
index 5303aea6d0..0d2550e53b 100644
--- a/servers/audio_server.cpp
+++ b/servers/audio_server.cpp
@@ -66,7 +66,8 @@ void AudioDriver::audio_server_process(int p_frames, int32_t *p_buffer, bool p_u
void AudioDriver::update_mix_time(int p_frames) {
_mix_amount += p_frames;
- _last_mix_time = OS::get_singleton()->get_ticks_usec();
+ if (OS::get_singleton())
+ _last_mix_time = OS::get_singleton()->get_ticks_usec();
}
double AudioDriver::get_mix_time() const {