From c964ed2b0bc9c38ea4f73abe982dff144e36a331 Mon Sep 17 00:00:00 2001 From: Thanasis Antoniou Date: Fri, 11 Oct 2019 21:48:45 +0300 Subject: ANDROID: Fix audio cd manager crash upon exit --- backends/platform/android/android.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/backends/platform/android/android.cpp b/backends/platform/android/android.cpp index 7513639f94..59a3c5a9fc 100644 --- a/backends/platform/android/android.cpp +++ b/backends/platform/android/android.cpp @@ -117,7 +117,18 @@ OSystem_Android::OSystem_Android(int audio_sample_rate, int audio_buffer_size) : OSystem_Android::~OSystem_Android() { ENTER(); - + // _audiocdManager should be deleted before _mixer! + // It is normally deleted in proper order in the OSystem destructor. + // However, currently _mixer is deleted here (OSystem_Android) + // and in the ModularBackend destructor, + // hence unless _audiocdManager is deleted here first, + // it will cause a crash for the Android app (arm64 v8a) upon exit + // -- when the audio cd manager was actually used eg. audio cd test of the testbed + // FIXME: A more proper fix would probably be to: + // - delete _mixer in the base class (OSystem) after _audiocdManager (this is already the current behavior) + // - remove its deletion from OSystem_Android and ModularBackend (this is what needs to be fixed). + delete _audiocdManager; + _audiocdManager = 0; delete _mixer; _mixer = 0; delete _fsFactory; -- cgit v1.2.3