【发布时间】:2021-06-02 18:36:28
【问题描述】:
最近我收到有关 firebase 崩溃的通知,这是消息:
[AVCaptureSession stopRunning] stopRunning may not be called between calls to beginConfiguration and commitConfiguration
我检查了我的代码,最奇怪的是我从不打电话,也没有提到 beginConfiguration() 和 commitConfiguration()。
在我的CameraManager 类中,这是触发崩溃的函数,它在 deinit 上调用:
func stop() {
guard isStarted else { return Log.w("CameraManager wasn't started") }
queue.async {
self.isStarted = false
self.isCapturingFrame = false
self.isCapturingCode = false
self.session?.stopRunning()
self.session = nil
self.device = nil
}
notificationCenter.removeObserver(self, name: UIApplication.didBecomeActiveNotification, object: nil)
layer.removeFromSuperlayer()
layer.session = nil
}
queue 只是一个串行调度队列。
无论我尝试什么,我都无法重现此崩溃。
尝试拉菜单、推送通知、打电话、模拟内存警告等...
澄清一下,我的代码中没有一个地方调用 beginConfiguration 和 commitConfiguration。
【问题讨论】:
标签: ios avfoundation avcapturesession