From 6e398ffb3a799ad4846ffc41a010d0b29b123f06 Mon Sep 17 00:00:00 2001 From: QuentinArguillere Date: Mon, 24 Jul 2023 18:06:26 +0200 Subject: [PATCH] Stop the core when app is terminated to make sure the Main Core doesn't stay in Shutdown state, which would block the App Extension when receiving push notifications --- Classes/LinphoneManager.m | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index 9758386cb..02c02893d 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -1569,8 +1569,11 @@ void popup_link_account_cb(LinphoneAccountCreator *creator, LinphoneAccountCreat [ftd stopAndDestroyAndRemove:FALSE]; } [_fileTransferDelegates removeAllObjects]; - - linphone_core_destroy(theLinphoneCore); + + if (linphone_core_get_global_state(LC) != LinphoneGlobalOff) { + linphone_core_stop(LC); + } + linphone_core_unref(theLinphoneCore); LOGI(@"Destroy linphonecore %p", theLinphoneCore); theLinphoneCore = nil;