Jitsi widget: Fix occasional crash on hang up

Apparently, jitsi does not call delegate methods always on the same thread. Come back to the main thread for safety.

https://github.com/matrix-org/riot-ios-rageshakes/issues/220
This commit is contained in:
manuroe
2017-08-18 16:42:50 +02:00
parent 7bfab5a1f0
commit 42183ced65
@@ -132,16 +132,19 @@ static const NSString *kJitsiServerUrl = @"https://jitsi.riot.im/";
- (void)conferenceLeft:(NSDictionary *)data
{
// The conference is over. Let the delegate close this view controller.
if (_delegate)
{
[_delegate jitsiViewController:self dismissViewJitsiController:nil];
}
else
{
// Do it ourself
[self dismissViewControllerAnimated:YES completion:nil];
}
dispatch_async(dispatch_get_main_queue(), ^{
// The conference is over. Let the delegate close this view controller.
if (_delegate)
{
[_delegate jitsiViewController:self dismissViewJitsiController:nil];
}
else
{
// Do it ourself
[self dismissViewControllerAnimated:YES completion:nil];
}
});
}
@end