Intel® Collaboration Suite for WebRTC
Community support and discussions on the Intel® Collaboration Suite for WebRTC (Intel® CS for WebRTC).

RTCConferenceClient会一直retain它的observer即使调用了remove也不行

xiuming_z_
Beginner
558 Views
class ConferenceViewController: UIViewController {
    var token: String!
    
    @IBOutlet weak var videoView: RTCEAGLVideoView!
    
    lazy var client: RTCConferenceClient = {[unowned self] in
        let config = RTCConferenceClientConfiguration()
        
        config.iceServers = []
        config.mediaCodec.videoCodec = VideoCodec.H264.rawValue
        
        let client = RTCConferenceClient(configuration: config)!
        
        
        return client
    }()

    override func viewDidLoad() {
        super.viewDidLoad()
        
        client.add(self)

        print(client)
    }

    override func viewDidDisappear(_ animated: Bool) {
        super.viewDidDisappear(animated)
    
        client.remove(self)
    }
    
    deinit {
        print("deinit")
    }
}

析构函数永远不会执行,但是如果不执行client.add(self)这句析构函数就会正常执行(SDK3.1)

0 Kudos
1 Reply
Jianjun_Z_Intel
Employee
558 Views

Hi xiuming,

removeObserver is an undocumented API, and it is not implemented yet.

0 Kudos
Reply