forked from mirrors/linphone-iphone
do not crash after destroying linphone core
This commit is contained in:
parent
47343025a3
commit
8432847288
3 changed files with 42 additions and 12 deletions
|
|
@ -192,17 +192,27 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
}
|
||||
|
||||
- (void)coreUpdateEvent:(NSNotification *)notif {
|
||||
if (IPAD) {
|
||||
if (linphone_core_video_display_enabled(LC) && linphone_core_video_preview_enabled(LC)) {
|
||||
linphone_core_set_native_preview_window_id(LC, (__bridge void *)(_videoPreview));
|
||||
[_backgroundView setHidden:FALSE];
|
||||
[_videoCameraSwitch setHidden:FALSE];
|
||||
} else {
|
||||
linphone_core_set_native_preview_window_id(LC, NULL);
|
||||
[_backgroundView setHidden:TRUE];
|
||||
[_videoCameraSwitch setHidden:TRUE];
|
||||
@try {
|
||||
if (IPAD) {
|
||||
if (linphone_core_video_display_enabled(LC) && linphone_core_video_preview_enabled(LC)) {
|
||||
linphone_core_set_native_preview_window_id(LC, (__bridge void *)(_videoPreview));
|
||||
[_backgroundView setHidden:FALSE];
|
||||
[_videoCameraSwitch setHidden:FALSE];
|
||||
} else {
|
||||
linphone_core_set_native_preview_window_id(LC, NULL);
|
||||
[_backgroundView setHidden:TRUE];
|
||||
[_videoCameraSwitch setHidden:TRUE];
|
||||
}
|
||||
}
|
||||
}
|
||||
@catch (NSException *exception) {
|
||||
if ([exception.name isEqualToString:@"LinphoneCoreException"]) {
|
||||
LOGE(@"Core already destroyed");
|
||||
return;
|
||||
}
|
||||
LOGE(@"Uncaught exception : %@", exception.description);
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Debug Functions
|
||||
|
|
|
|||
|
|
@ -97,7 +97,17 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
#pragma mark - Event Functions
|
||||
|
||||
- (void)coreUpdateEvent:(NSNotification *)notif {
|
||||
[self update];
|
||||
@try {
|
||||
[self update];
|
||||
}
|
||||
@catch (NSException *exception) {
|
||||
if ([exception.name isEqualToString:@"LinphoneCoreException"]) {
|
||||
LOGE(@"Core already destroyed");
|
||||
return;
|
||||
}
|
||||
LOGE(@"Uncaught exception : %@", exception.description);
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
- (void) deviceOrientationDidChange:(NSNotification*) notif {
|
||||
|
|
|
|||
|
|
@ -81,8 +81,18 @@
|
|||
#pragma mark - Event Functions
|
||||
|
||||
- (void)coreUpdateEvent:(NSNotification *)notif {
|
||||
// Invalid all pointers
|
||||
[self loadData];
|
||||
@try {
|
||||
// Invalid all pointers
|
||||
[self loadData];
|
||||
}
|
||||
@catch (NSException *exception) {
|
||||
if ([exception.name isEqualToString:@"LinphoneCoreException"]) {
|
||||
LOGE(@"Core already destroyed");
|
||||
return;
|
||||
}
|
||||
LOGE(@"Uncaught exception : %@", exception.description);
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Property Functions
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue