- Notify LinphoneCallUpdate on call back thread

- Fix "no more call" detection to dismiss call views within call call back itself.
This commit is contained in:
Christophe Deschamps 2021-09-16 10:27:52 +02:00
parent b9f8a7f025
commit e8a348ada2
2 changed files with 6 additions and 8 deletions

View file

@ -642,13 +642,11 @@ import AVFoundation
}
}
// post Notification kLinphoneCallUpdate
DispatchQueue.main.async {
NotificationCenter.default.post(name: Notification.Name("LinphoneCallUpdate"), object: self, userInfo: [
AnyHashable("call"): NSValue.init(pointer:UnsafeRawPointer(call.getCobject)),
AnyHashable("state"): NSNumber(value: cstate.rawValue),
AnyHashable("message"): message
])
}
NotificationCenter.default.post(name: Notification.Name("LinphoneCallUpdate"), object: self, userInfo: [
AnyHashable("call"): NSValue.init(pointer:UnsafeRawPointer(call.getCobject)),
AnyHashable("state"): NSNumber(value: cstate.rawValue),
AnyHashable("message"): message
])
}

View file

@ -403,7 +403,7 @@ static RootViewManager *rootViewManagerInstance = nil;
}
case LinphoneCallEnd: {
const MSList *calls = linphone_core_get_calls(LC);
if (!calls) {
if (!calls || calls->data == call) {
while ((currentView == CallView.compositeViewDescription) ||
(currentView == CallIncomingView.compositeViewDescription) ||
(currentView == CallOutgoingView.compositeViewDescription)) {