fix crash: enter background mode when linphonecore off

This commit is contained in:
Danmei Chen 2020-05-25 18:05:39 +02:00
parent 506d7b3703
commit 5cf6db0dd9

View file

@ -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 {