Fix crash when deleting a contact with phone and sip address while editing

This commit is contained in:
Benjamin Reis 2016-12-23 14:26:02 +01:00
parent b5c044bea8
commit 289c996684
2 changed files with 7 additions and 1 deletions

View file

@ -28,6 +28,7 @@
@private
OrderedDictionary *addressBookMap;
}
@property(nonatomic) BOOL ongoing;
- (void)loadData;
- (void)loadSearchedData;
- (void)removeAllContacts;

View file

@ -36,7 +36,9 @@
}
- (void)onAddressBookUpdate:(NSNotification *)k {
[self loadData];
if (!_ongoing && (PhoneMainView.instance.currentView == ContactsListView.compositeViewDescription)) {
[self loadData];
}
}
- (void)viewWillAppear:(BOOL)animated {
@ -54,6 +56,7 @@
if (self) {
[self initContactsTableViewController];
}
_ongoing = FALSE;
return self;
}
@ -119,6 +122,7 @@ static int ms_strcmpfuz(const char *fuzzy_word, const char *sentence) {
}
- (void)loadData {
_ongoing = TRUE;
LOGI(@"Load contact list");
@synchronized(addressBookMap) {
//Set all contacts from ContactCell to nil
@ -192,6 +196,7 @@ static int ms_strcmpfuz(const char *fuzzy_word, const char *sentence) {
}
});
}
_ongoing = FALSE;
}
- (void)loadSearchedData {