Dispose the call notification in LinphoneManager

This commit is contained in:
Yann Diorcet 2013-01-17 11:37:41 +01:00
parent 4eb1ec1b19
commit 9fa089c2ef
2 changed files with 15 additions and 22 deletions

View file

@ -455,16 +455,7 @@ static void linphone_iphone_display_status(struct _LinphoneCore * lc, const char
}
}
}
if(state == LinphoneCallReleased) {
if(data != NULL) {
[data release];
linphone_call_set_user_pointer(call, NULL);
}
}
// Disable speaker when no more call
if ((state == LinphoneCallEnd || state == LinphoneCallError)) {
if(linphone_core_get_calls_nb(theLinphoneCore) == 0) {
@ -474,7 +465,20 @@ static void linphone_iphone_display_status(struct _LinphoneCore * lc, const char
if (incallBgTask) {
[[UIApplication sharedApplication] endBackgroundTask:incallBgTask];
incallBgTask=0;
}
}
if(data != nil && data->notification != nil) {
// cancel local notif if needed
[[UIApplication sharedApplication] cancelLocalNotification:data->notification];
[data->notification release];
data->notification = nil;
}
}
if(state == LinphoneCallReleased) {
if(data != NULL) {
[data release];
linphone_call_set_user_pointer(call, NULL);
}
}
// Enable speaker when video

View file

@ -288,7 +288,6 @@ static PhoneMainView* phoneMainViewInstance=nil;
}
case LinphoneCallEnd:
{
[self dismissIncomingCall:call];
if (canHideInCallView) {
// Go to dialer view
DialerViewController *controller = DYNAMIC_CAST([self changeCurrentView:[DialerViewController compositeViewDescription]], DialerViewController);
@ -528,16 +527,6 @@ static PhoneMainView* phoneMainViewInstance=nil;
[error release];
}
- (void)dismissIncomingCall:(LinphoneCall*)call {
LinphoneCallAppData* appData = (LinphoneCallAppData*) linphone_call_get_user_pointer(call);
if(appData != nil && appData->notification != nil) {
// cancel local notif if needed
[[UIApplication sharedApplication] cancelLocalNotification:appData->notification];
[appData->notification release];
}
}
- (void)addInhibitedEvent:(id)event {
[inhibitedEvents addObject:event];
}