OpenTok iOS SDK crash: -[OTSubscriber renderer:didReceiveFrame:]_block_invoke OpenTok iOS SDK crash: -[OTSubscriber renderer:didReceiveFrame:]_block_invoke

OpenTok iOS SDK crash: -[OTSubscriber renderer:didReceiveFrame:]_block_invoke

Kenny Domingo

Symptom

iOS app crashes sometimes when the there is a close out of a screen that holds a strong reference to OTSubscribers. 

Applies To

  • iOS

Resolution

To resolve this issue deinit block with below code ( in ChatViewController.swift):

deinit {
print("deinit")
publisher.delegate = nil;
for sub in subscribers {
sub.delegate = nil
}
session.delegate = nil;

}

This sub streams delegates deallocation by assigning nil value and now crash should not appear.

Cause

It seems it may be trying to render a frame for a subscriber that's being deallocated. 

 

Additional Information

iOS 15, iOS 16, iOS 17 were tested and crash appeared