Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
58 Views

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

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)

Tags (2)
0 Kudos
1 Reply
Highlighted
58 Views

Hi xiuming,

Hi xiuming,

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

0 Kudos