所以這裏是我的問題:我創建了一個自定義的AVCaptureSession拍照。我不知道爲什麼,但第三次你撥打startRunning
,它崩潰了。我實施了didReceiveMemoryWarning
,它在墜毀之前沒有被調用。我還在上面運行了儀器,並且沒有與AVCaptureSession相關的內存泄漏。在XCode中也沒有通過控制檯的日誌。AVCaptureSession「startRunning」crash
所以我的問題是...即使didReceiveMemoryWarning
沒有被調用,它是一個內存問題嗎?這是我的一些代碼。
viewWillDisappear(視圖控制器)
- (void)viewWillDisappear:(BOOL)animated {
if (cameraFlashButton) { [cameraFlashButton release]; }
if (switchCamera) { [switchCamera release]; }
if (cameraBadgeBack) { [cameraBadgeBack release]; }
if (cameraBadgeNumber) { [cameraBadgeNumber release]; }
if (cameraUseButton) { [cameraUseButton release]; }
if (cameraOverlayView) { [cameraOverlayView release]; }
if (blackOverlay) { [blackOverlay release]; }
if (loadingIndicator) { [loadingIndicator release]; }
if (cameraPickButton) { [cameraPickButton release]; }
if (whiteOverlay) { [whiteOverlay release]; }
if (imageOverlay) { [imageOverlay release]; }
if (captureManager) { [captureManager release], captureManager = nil; }
if (theCaptureSession) { [theCaptureSession release], theCaptureSession = nil; }
[super viewWillDisappear:YES];
}
的dealloc(CaptureSessionManager)
- (void)dealloc {
if ([self captureSession]) { [[self captureSession] stopRunning]; }
if (previewLayer) { [previewLayer release], previewLayer = nil; }
if (captureSession) { [captureSession release], captureSession = nil; }
if (stillImageOutput) { [stillImageOutput release], stillImageOutput = nil; }
if (stillImage) { [stillImage release], stillImage = nil; }
[super dealloc];
}
想法?如果您需要查看其他內容,只需詢問!提前致謝。
搞砸了一下後,我fo解決問題。顯然這是一個內存問題,但我通過將分辨率更改爲較低質量,並且比以往更快捷地修復了問題。 – iosfreak 2012-07-06 03:18:09
你會上傳答案你做了什麼 – java 2013-09-05 10:01:17