Maulik shah
Maulik shah

Reputation: 1704

How to solve EAGLContext crash in iOS?

I am working on live video call app using OpenTok(TokBox) using this demo : https://github.com/opentok/opentok-ios-sdk-samples/tree/develop/5.Multi-Party-Call

My problem is when I navigate from live call screen to main view(root view controller) then my app is crashed.

see following screen shot for crash log

enter image description here

Any help would be appreciated.

Upvotes: 0

Views: 314

Answers (1)

Jaideep Shah
Jaideep Shah

Reputation: 146

Make sure that OT objects (OTSession.OTPublisher and OTSubscriber) are properly released. Something outside of your view controller may still be holding onto this objects, and when the view controller moves out, OT objects may still be alive and active and trying to access released or non existent resources.

As a side note the proper way to release OT objects is as follows(assuming a two way call, can be generalized for multi-party):

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

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

[_session disconnect:nil];

and on sessionDidDisconnect callback you can make

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

Upvotes: 1

Related Questions