gpt4 book ai didi

ios - 如何解决 iOS 中的 EAGLContext 崩溃?

转载 作者:行者123 更新时间:2023-11-29 01:14:02 25 4
gpt4 key购买 nike

我正在使用 OpenTok(TokBox) 使用此演示开发实时视频通话应用程序:https://github.com/opentok/opentok-ios-sdk-samples/tree/develop/5.Multi-Party-Call

我的问题是,当我从实时调用屏幕导航到主视图( Root View Controller )时,我的应用程序崩溃了。

查看崩溃日志的以下屏幕截图

enter image description here

如有任何帮助,我们将不胜感激。

最佳答案

确保 OT 对象(OTSession.OTPublisher 和 OTSubscriber)已正确发布。您的 View Controller 之外的某些东西可能仍然持有此对象,并且当 View Controller 移出时,OT 对象可能仍然存在并处于事件状态并尝试访问已释放或不存在的资源。

作为旁注,释放 OT 对象的正确方法如下(假设是双向调用,可以推广到多方调用):

    [_publisher.view removeFromSuperview];
_publisher.delegate = nil;
_publisher = nil;

[_subscriber.view removeFromSuperview];
_subscriber.delegate = nil;
_subscriber = nil;

[_session disconnect:nil];

你可以在 sessionDidDisconnect 回调上做

_session = nil; // in your case you would not wait for this as iOS takes care of it.

关于ios - 如何解决 iOS 中的 EAGLContext 崩溃?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35435763/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com