mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-07 14:18:25 +00:00
chat: fix crash on iPad when having already some conversations started leading to "[CALayer retain]: message sent to deallocated instance" crash
This commit is contained in:
parent
a62aaee025
commit
fc0181b75b
3 changed files with 10 additions and 6 deletions
|
|
@ -36,8 +36,6 @@
|
|||
- (void)viewWillAppear:(BOOL)animated {
|
||||
[super viewWillAppear:animated];
|
||||
self.tableView.accessibilityIdentifier = @"ChatRoom list";
|
||||
// this should not be needed, we should only load messages when setting the chat room
|
||||
// [self reloadData];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
|
|
|||
|
|
@ -54,6 +54,15 @@
|
|||
[self loadData];
|
||||
}
|
||||
|
||||
- (void)viewDidAppear:(BOOL)animated {
|
||||
[super viewDidAppear:animated];
|
||||
// we cannot do that in viewWillAppear because we will change view while previous transition
|
||||
// was not finished, leading to "[CALayer retain]: message sent to deallocated instance" error msg
|
||||
if (IPAD && [self totalNumberOfItems] == 0) {
|
||||
[PhoneMainView.instance changeCurrentView:ChatConversationCreateView.compositeViewDescription];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
static int sorted_history_comparison(LinphoneChatRoom *to_insert, LinphoneChatRoom *elem) {
|
||||
|
|
@ -115,9 +124,6 @@ static void chatTable_free_chatrooms(void *data) {
|
|||
if ([self totalNumberOfItems] > 0) {
|
||||
ChatConversationView *view = VIEW(ChatConversationView);
|
||||
[view setChatRoom:(LinphoneChatRoom *)ms_list_nth_data(data, 0)];
|
||||
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
|
||||
} else {
|
||||
[PhoneMainView.instance changeCurrentView:ChatConversationCreateView.compositeViewDescription];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
sideMenu:SideMenuView.class
|
||||
fullscreen:false
|
||||
isLeftFragment:YES
|
||||
fragmentWith:ChatConversationCreateView.class];
|
||||
fragmentWith:ChatConversationView.class];
|
||||
}
|
||||
return compositeDescription;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue