From 1e3bf80a91aa81325379bdcd3ddc35ac0bbbd5b1 Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Fri, 31 Mar 2017 10:29:16 +0200 Subject: [PATCH] Fix crash when transferring a call --- Classes/LinphoneManager.m | 4 +--- Classes/ProviderDelegate.m | 2 ++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index e70b8f92d..6acfc3cdc 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -892,8 +892,6 @@ static void linphone_iphone_display_status(struct _LinphoneCore *lc, const char connectedAtDate:nil]; } - [self.providerDelegate.uuids removeObjectForKey:callId2]; - [self.providerDelegate.calls removeObjectForKey:uuid]; CXEndCallAction *act = [[CXEndCallAction alloc] initWithCallUUID:uuid]; CXTransaction *tr = [[CXTransaction alloc] initWithAction:act]; [LinphoneManager.instance.providerDelegate.controller requestTransaction:tr @@ -2155,7 +2153,7 @@ static int comp_call_id(const LinphoneCall *call, const char *callid) { - (LinphoneCall *)callByCallId:(NSString *)call_id { const bctbx_list_t *calls = linphone_core_get_calls(theLinphoneCore); - if (!calls) { + if (!calls || !call_id) { return NULL; } bctbx_list_t *call_tmp = bctbx_list_find_custom(calls, (bctbx_compare_func)comp_call_id, [call_id UTF8String]); diff --git a/Classes/ProviderDelegate.m b/Classes/ProviderDelegate.m index 232829f31..e7936cd3e 100644 --- a/Classes/ProviderDelegate.m +++ b/Classes/ProviderDelegate.m @@ -133,6 +133,8 @@ if (call) { linphone_call_terminate((LinphoneCall *)call); } + [self.uuids removeObjectForKey:callID]; + [self.calls removeObjectForKey:uuid]; } }