From 5cf6db0dd913f918e27d0556af6ba8a00fe5f019 Mon Sep 17 00:00:00 2001 From: Danmei Chen Date: Mon, 25 May 2020 18:05:39 +0200 Subject: [PATCH] fix crash: enter background mode when linphonecore off --- Classes/LinphoneAppDelegate.m | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index 456bdea36..58021e341 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -57,9 +57,11 @@ - (void)applicationDidEnterBackground:(UIApplication *)application { LOGI(@"%@", NSStringFromSelector(_cmd)); - [LinphoneManager.instance enterBackgroundMode]; - [LinphoneManager.instance.fastAddressBook clearFriends]; - [CoreManager.instance stopLinphoneCore]; + if (linphone_core_get_global_state(LC) != LinphoneGlobalOff) { + [LinphoneManager.instance enterBackgroundMode]; + [LinphoneManager.instance.fastAddressBook clearFriends]; + [CoreManager.instance stopLinphoneCore]; + } } - (void)applicationWillEnterForeground:(UIApplication *)application {