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)
Hi xiuming,
removeObserver is an undocumented API, and it is not implemented yet.
For more complete information about compiler optimizations, see our Optimization Notice.