[peerConnection removeStream:lms];[peerConnection close];peerConnection = nil;
我之前使用的代码几乎删除了与webrtc相关的任何内容,但我发现很多对象都可以重用,只需要在应用程序开始时进行.我该怎么做才能确保应用程序不会崩溃我结束通话的所有内容?
>我正在使用修订版6825
>我正在使用xcode 5.1.1
>在第4代iPad上测试,运行iOS7
编辑:
我将上面的代码移动到后台线程,它不再崩溃.但现在,经过几次通话后,我的日志会被以下行发送垃圾邮件(大约每秒3或4次):
Failed to make complete framebuffer object 8cdd
发生这种情况时,这是日志历史记录的最后一部分:
2014-10-14 11:53:45.045 BeeldZorgApp[4912:3903] peerConnection iceConnectionChanged:(RTCICEConnectionState)22014-10-14 11:53:45.046 BeeldZorgApp[4912:3903] peerConnection iceConnectionChanged:(RTCICEConnectionState)32014-10-14 11:53:50.732 BeeldZorgApp[4912:3903] peerConnectionOnRenegotiationNeeded:(RTCPeerConnection *)<RTCPeerConnection: 0x157c9640>2014-10-14 11:53:50.742 BeeldZorgApp[4912:3903] peerConnection iceConnectionChanged:(RTCICEConnectionState)62014-10-14 11:53:50.743 BeeldZorgApp[4912:3903] peerConnection signalingStateChanged:(RTCSignalingState)52014-10-14 11:53:59.955 BeeldZorgApp[4912:3903] peerConnectionOnRenegotiationNeeded:(RTCPeerConnection *)<RTCPeerConnection: 0x19a62e30>2014-10-14 11:53:59.980 BeeldZorgApp[4912:60b] Failed to make complete framebuffer object 8cdd2014-10-14 11:54:00.028 BeeldZorgApp[4912:60b] Failed to make complete framebuffer object 8cdd2014-10-14 11:54:00.091 BeeldZorgApp[4912:60b] Failed to make complete framebuffer object 8cdd2014-10-14 11:54:00.119 BeeldZorgApp[4912:60b] Failed to make complete framebuffer object 8cdd2014-10-14 11:54:00.152 BeeldZorgApp[4912:60b] Failed to make complete framebuffer object 8cdd2014-10-14 11:54:00.185 BeeldZorgApp[4912:60b] Failed to make complete framebuffer object 8cdd2014-10-14 11:54:00.218 BeeldZorgApp[4912:60b] Failed to make complete framebuffer object 8cdd2014-10-14 11:54:00.252 BeeldZorgApp[4912:60b] Failed to make complete framebuffer object 8cdd2014-10-14 11:54:00.284 BeeldZorgApp[4912:60b] Failed to make complete framebuffer object 8cdd2014-10-14 11:54:00.319 BeeldZorgApp[4912:60b] Failed to make complete framebuffer object 8cdd2014-10-14 11:54:00.352 BeeldZorgApp[4912:60b] Failed to make complete framebuffer object 8cdd2014-10-14 11:54:00.384 BeeldZorgApp[4912:60b] Failed to make complete framebuffer object 8cdd2014-10-14 11:54:00.417 BeeldZorgApp[4912:60b] Failed to make complete framebuffer object 8cdd2014-10-14 11:54:00.451 BeeldZorgApp[4912:60b] Failed to make complete framebuffer object 8cdd2014-10-14 11:54:00.486 BeeldZorgApp[4912:60b] Failed to make complete framebuffer object 8cdd2014-10-14 11:54:00.518 BeeldZorgApp[4912:60b] Failed to make complete framebuffer object 8cdd2014-10-14 11:54:00.552 BeeldZorgApp[4912:60b] Failed to make complete framebuffer object 8cdd解决方法 事实证明,在远离视图控制器之前,需要从超级视图中删除RTCEAGLVIDeoVIEw.我现在使用以下代码进行清理:
//these are both RTCEAGLVIDeoVIEws[remoteVIDeoVIEw removeFromSupervIEw];[localVIDeoVIEw removeFromSupervIEw];[peerConnection removeStream:lms];[peerConnection close];peerConnection = nil;总结
以上是内存溢出为你收集整理的ios – 如何正确关闭对等连接全部内容,希望文章能够帮你解决ios – 如何正确关闭对等连接所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)