diff options
author | Thanasis Antoniou | 2019-10-11 21:48:45 +0300 |
---|---|---|
committer | Thanasis Antoniou | 2019-10-11 21:49:18 +0300 |
commit | c964ed2b0bc9c38ea4f73abe982dff144e36a331 (patch) | |
tree | aeba5e95d5170126405597cccb8195231f8ebf32 | |
parent | 37293f5b3f3c80b3190f058313a3a43403e3a454 (diff) | |
download | scummvm-rg350-c964ed2b0bc9c38ea4f73abe982dff144e36a331.tar.gz scummvm-rg350-c964ed2b0bc9c38ea4f73abe982dff144e36a331.tar.bz2 scummvm-rg350-c964ed2b0bc9c38ea4f73abe982dff144e36a331.zip |
ANDROID: Fix audio cd manager crash upon exit
-rw-r--r-- | backends/platform/android/android.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
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; |