1
0
mirror of https://github.com/godotengine/godot.git synced 2026-01-06 19:41:11 +00:00

Fix possible crash at exit on iOS

This commit is contained in:
Marcelo Fernandez
2017-10-02 10:39:32 -03:00
committed by Marcelo
parent 9a793659dd
commit 116e735e8b
3 changed files with 20 additions and 8 deletions

View File

@@ -175,8 +175,17 @@ void AudioDriverIphone::unlock() {
};
void AudioDriverIphone::finish() {
AURenderCallbackStruct callback;
zeromem(&callback, sizeof(AURenderCallbackStruct));
OSStatus result = AudioUnitSetProperty(audio_unit, kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Input, 0, &callback, sizeof(callback));
if (result != noErr) {
ERR_PRINT("AudioUnitSetProperty failed");
}
memdelete_arr(samples_in);
if (samples_in) {
memdelete_arr(samples_in);
samples_in = NULL;
}
};
AudioDriverIphone::AudioDriverIphone() {

View File

@@ -371,6 +371,14 @@ void OSIPhone::finalize() {
if (main_loop) // should not happen?
memdelete(main_loop);
spatial_sound_server->finish();
memdelete(spatial_sound_server);
spatial_sound_2d_server->finish();
memdelete(spatial_sound_2d_server);
audio_server->finish();
memdelete(audio_server);
visual_server->finish();
memdelete(visual_server);
memdelete(rasterizer);
@@ -381,13 +389,7 @@ void OSIPhone::finalize() {
physics_2d_server->finish();
memdelete(physics_2d_server);
spatial_sound_server->finish();
memdelete(spatial_sound_server);
memdelete(input);
spatial_sound_2d_server->finish();
memdelete(spatial_sound_2d_server);
};
void OSIPhone::set_mouse_show(bool p_show){};