From 4a8c391e007daaf7f35d890852072e8f86cf9c48 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Fri, 27 Sep 2019 10:24:09 +0200 Subject: [PATCH] Improved LinphoneManager destroy method --- app/src/main/java/org/linphone/LinphoneManager.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/org/linphone/LinphoneManager.java b/app/src/main/java/org/linphone/LinphoneManager.java index 71773fc4b..59fea40df 100644 --- a/app/src/main/java/org/linphone/LinphoneManager.java +++ b/app/src/main/java/org/linphone/LinphoneManager.java @@ -423,13 +423,11 @@ public class LinphoneManager implements SensorEventListener { if (mMediaScanner != null) mMediaScanner.destroy(); if (mAudioManager != null) mAudioManager.destroy(); - try { - mTimer.cancel(); - if (mAutoAnswerTimer != null) mAutoAnswerTimer.cancel(); + if (mTimer != null) mTimer.cancel(); + if (mAutoAnswerTimer != null) mAutoAnswerTimer.cancel(); + + if (mCore != null) { destroyCore(); - } catch (RuntimeException e) { - Log.e("[Manager] Destroy Core Runtime Exception: " + e); - } finally { mCore = null; } }