mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
fix crash of remove null callbacks
This commit is contained in:
parent
05de1c3783
commit
54dfce82a7
1 changed files with 9 additions and 6 deletions
|
|
@ -203,10 +203,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
- (void)viewWillDisappear:(BOOL)animated {
|
||||
[super viewWillDisappear:animated];
|
||||
|
||||
if (_chatRoom && _chatRoomCbs) {
|
||||
linphone_chat_room_remove_callbacks(_chatRoom, _chatRoomCbs);
|
||||
_chatRoomCbs = NULL;
|
||||
}
|
||||
[self removeCallBacks];
|
||||
|
||||
[_messageField resignFirstResponder];
|
||||
|
||||
|
|
@ -217,8 +214,14 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
}
|
||||
|
||||
- (void)didEnterBackground:(NSNotification *)notif {
|
||||
linphone_chat_room_remove_callbacks(_chatRoom, _chatRoomCbs);
|
||||
_chatRoomCbs = NULL;
|
||||
[self removeCallBacks];
|
||||
}
|
||||
|
||||
- (void)removeCallBacks {
|
||||
if (_chatRoom && _chatRoomCbs) {
|
||||
linphone_chat_room_remove_callbacks(_chatRoom, _chatRoomCbs);
|
||||
_chatRoomCbs = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue