From 73fd1837f5a777bcb5ff69b76b88b0abe8526410 Mon Sep 17 00:00:00 2001 From: REIS Benjamin Date: Fri, 28 Oct 2016 11:54:46 +0200 Subject: [PATCH] No memory leak when deleting a contact --- Classes/ContactsListTableView.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Classes/ContactsListTableView.m b/Classes/ContactsListTableView.m index a4b5be99b..f1d9f78a8 100644 --- a/Classes/ContactsListTableView.m +++ b/Classes/ContactsListTableView.m @@ -349,6 +349,8 @@ static int ms_strcmpfuz(const char *fuzzy_word, const char *sentence) { [tableView deleteSections:[NSIndexSet indexSetWithIndex:indexPath.section] withRowAnimation:UITableViewRowAnimationFade]; } + UIContactCell* cell = [self.tableView cellForRowAtIndexPath:indexPath]; + [cell setContact:NULL]; [[LinphoneManager.instance fastAddressBook] removeContact:contact]; [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade]; @@ -358,6 +360,7 @@ static int ms_strcmpfuz(const char *fuzzy_word, const char *sentence) { selector:@selector(onAddressBookUpdate:) name:kLinphoneAddressBookUpdate object:nil]; + [self loadData]; } } @@ -372,6 +375,8 @@ static int ms_strcmpfuz(const char *fuzzy_word, const char *sentence) { if (subAr.count == 0) { [addressBookMap removeObjectForKey:firstChar]; } + UIContactCell* cell = [self.tableView cellForRowAtIndexPath:indexPath]; + [cell setContact:NULL]; [[LinphoneManager.instance fastAddressBook] removeContact:contact]; [NSNotificationCenter.defaultCenter addObserver:self