forked from mirrors/linphone-iphone
Chat: fix crash
This commit is contained in:
parent
d49f06d733
commit
0e61311a27
2 changed files with 9 additions and 5 deletions
|
|
@ -86,7 +86,8 @@ static int sorted_history_comparison(LinphoneChatRoom *to_insert, LinphoneChatRo
|
|||
ms_list_free(history);
|
||||
}
|
||||
linphone_chat_room_set_user_data(chat_room, last_msg);
|
||||
sorted = ms_list_insert_sorted(sorted, chat_room, (MSCompareFunc)sorted_history_comparison);
|
||||
sorted =
|
||||
ms_list_insert_sorted(sorted, linphone_chat_room_ref(chat_room), (MSCompareFunc)sorted_history_comparison);
|
||||
iter = iter->next;
|
||||
}
|
||||
return sorted;
|
||||
|
|
@ -98,6 +99,7 @@ static void chatTable_free_chatrooms(void *data) {
|
|||
linphone_chat_message_unref(lastMsg);
|
||||
linphone_chat_room_set_user_data(data, NULL);
|
||||
}
|
||||
linphone_chat_room_unref(data);
|
||||
}
|
||||
|
||||
- (void)loadData {
|
||||
|
|
|
|||
|
|
@ -156,10 +156,12 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
- (IBAction)onContactClick:(id)event {
|
||||
LinphoneAddress *addr = linphone_call_log_get_remote_address(callLog);
|
||||
ABRecordRef contact = [FastAddressBook getContactWithAddress:addr];
|
||||
ContactDetailsView *view = VIEW(ContactDetailsView);
|
||||
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription push:TRUE];
|
||||
[ContactSelection setSelectionMode:ContactSelectionModeNone];
|
||||
[view setContact:contact];
|
||||
if (contact) {
|
||||
ContactDetailsView *view = VIEW(ContactDetailsView);
|
||||
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription push:TRUE];
|
||||
[ContactSelection setSelectionMode:ContactSelectionModeNone];
|
||||
[view setContact:contact];
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)onAddContactClick:(id)event {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue