mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
fix crash when remove callbacks
This commit is contained in:
parent
f1bc077efa
commit
29d484ea34
3 changed files with 5 additions and 8 deletions
|
|
@ -112,5 +112,6 @@
|
|||
- (void)showFileDownloadError;
|
||||
- (NSURL *)getICloudFileUrl:(NSString *)name;
|
||||
- (BOOL)writeFileInICloud:(NSData *)data fileURL:(NSURL *)fileURL;
|
||||
- (void)removeCallBacks;
|
||||
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -175,10 +175,6 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
selector:@selector(onLinphoneCoreReady:)
|
||||
name:kLinphoneGlobalStateUpdate
|
||||
object:nil];
|
||||
[NSNotificationCenter.defaultCenter addObserver:self
|
||||
selector:@selector(didEnterBackground:)
|
||||
name:UIApplicationDidEnterBackgroundNotification
|
||||
object:nil];
|
||||
if ([_imagesArray count] > 0) {
|
||||
[UIView animateWithDuration:0
|
||||
delay:0
|
||||
|
|
@ -213,10 +209,6 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
PhoneMainView.instance.currentRoom = NULL;
|
||||
}
|
||||
|
||||
- (void)didEnterBackground:(NSNotification *)notif {
|
||||
[self removeCallBacks];
|
||||
}
|
||||
|
||||
- (void)removeCallBacks {
|
||||
if (_chatRoom && _chatRoomCbs) {
|
||||
linphone_chat_room_remove_callbacks(_chatRoom, _chatRoomCbs);
|
||||
|
|
|
|||
|
|
@ -60,6 +60,10 @@
|
|||
if (linphone_core_get_global_state(LC) != LinphoneGlobalOff) {
|
||||
[LinphoneManager.instance enterBackgroundMode];
|
||||
[LinphoneManager.instance.fastAddressBook clearFriends];
|
||||
if (PhoneMainView.instance.currentView == ChatConversationView.compositeViewDescription) {
|
||||
ChatConversationView *view = VIEW(ChatConversationView);
|
||||
[view removeCallBacks];
|
||||
}
|
||||
[CoreManager.instance stopLinphoneCore];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue