Commit 03a9fd46 authored by panxiaochun's avatar panxiaochun

fix the problem: leak memory when repeatedly start and stop

parent bdfb4dec
...@@ -203,11 +203,11 @@ ...@@ -203,11 +203,11 @@
} }
[self.captureSession stopRunning]; [self.captureSession stopRunning];
self.captureSession = nil; [self.captureSession release];
} }
self.captureVideoPreviewLayer = nil; [self.captureVideoPreviewLayer release];
self.videoCaptureConnection = nil; [self.videoCaptureConnection release];
captureSessionLoaded = NO; captureSessionLoaded = NO;
} }
......
...@@ -131,7 +131,7 @@ static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;} ...@@ -131,7 +131,7 @@ static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;}
{ {
[super stop]; [super stop];
self.videoDataOutput = nil; [self.videoDataOutput release];
if (videoDataOutputQueue) { if (videoDataOutputQueue) {
dispatch_release(videoDataOutputQueue); dispatch_release(videoDataOutputQueue);
} }
...@@ -144,11 +144,11 @@ static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;} ...@@ -144,11 +144,11 @@ static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;}
} else { } else {
NSLog(@"[Camera] Recording Error: asset writer status is not writing"); NSLog(@"[Camera] Recording Error: asset writer status is not writing");
} }
self.recordAssetWriter = nil; [self.recordAssetWriter release];
} }
self.recordAssetWriterInput = nil; [self.recordAssetWriterInput release];
self.recordPixelBufferAdaptor = nil; [self.recordPixelBufferAdaptor release];
} }
if (self.customPreviewLayer) { if (self.customPreviewLayer) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment