newOcean/webrtc-ios

Crash when closing peerConnection

Opened this issue · 0 comments

I've forked your repository and before I start thank you for effort on this project!

Problem I have is that I can't close session, app always crashes. I try to close it like this:
[self.client sendData:[@"{"type": "bye"}" dataUsingEncoding:NSUTF8StringEncoding]];

[self.peerConnection close];
self.peerConnection = nil;

self.peerConnectionFactory = nil;
self.client.ICEServerDelegate = nil;
self.client.messageHandler = nil;
self.client = nil;

[RTCPeerConnectionFactory deinitializeSSL];

Exception I get is this:
-[VideoCaptureIosObjC onVideoError:]: unrecognized selector sent to instance 0x17ee7010

I assume it's coming from Google libraries but how can I fix that problem?
Or maybe I'm doing something wrong when I try to end call?