mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 19:18:06 +00:00
Fix null pointer exception when call released
This commit is contained in:
parent
d5193453a7
commit
d160fc08f0
1 changed files with 8 additions and 3 deletions
|
|
@ -141,6 +141,14 @@ extern void libmsbcg729_init();
|
|||
}
|
||||
|
||||
-(void) onCall:(LinphoneCall*) call StateChanged: (LinphoneCallState) new_state withMessage: (const char *) message {
|
||||
if(new_state == LinphoneCallReleased) {
|
||||
if(linphone_call_get_user_pointer(call) != NULL) {
|
||||
free (linphone_call_get_user_pointer(call));
|
||||
linphone_call_set_user_pointer(call, NULL);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
const char* lUserNameChars=linphone_address_get_username(linphone_call_get_remote_address(call));
|
||||
NSString* lUserName = lUserNameChars?[[[NSString alloc] initWithUTF8String:lUserNameChars] autorelease]:NSLocalizedString(@"Unknown",nil);
|
||||
if (new_state == LinphoneCallIncomingReceived) {
|
||||
|
|
@ -269,9 +277,6 @@ extern void libmsbcg729_init();
|
|||
[callDelegate displayInCall:call FromUI:mCurrentViewController forUser:lUserName withDisplayName:lDisplayName];
|
||||
}
|
||||
break;
|
||||
case LinphoneCallReleased:
|
||||
free (linphone_call_get_user_pointer(call));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue