【问题标题】:How to solve EAGLContext crash in iOS?如何解决 iOS 中的 EAGLContext 崩溃?
【发布时间】:2016-02-16 14:56:32
【问题描述】:

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

我的问题是当我从实时呼叫屏幕导航到主视图(根视图控制器)时,我的应用程序崩溃了。

请参阅以下屏幕截图以获取崩溃日志

任何帮助将不胜感激。

【问题讨论】:

    标签: ios objective-c opentok tokbox


    【解决方案1】:

    确保正确发布 OT 对象(OTSession.OTPublisher 和 OTSubscriber)。您的视图控制器之外的东西可能仍然持有这些对象,当视图控制器移出时,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.
    

    【讨论】:

    • 我删除了视图中的所有对象 diddisapper 但不工作,我的项目是 arc
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-16
    • 2015-07-08
    • 1970-01-01
    • 2022-10-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多