diff --git a/LLSimpleCamera.podspec b/LLSimpleCamera.podspec index 0be3c60..22fda30 100644 --- a/LLSimpleCamera.podspec +++ b/LLSimpleCamera.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "LLSimpleCamera" - s.version = "1.1.0" + s.version = "1.1.1" s.summary = "LLSimpleCamera: A simple customizable camera control." s.description = <<-DESC LLSimpleCamera is a library for creating a customized camera screens similar to snapchat's. You don't have to present the camera in a new view controller. @@ -15,7 +15,7 @@ hides the nitty gritty details from the developer s.license = { :type => 'APACHE', :file => 'LICENSE' } s.author = { "Ömer Faruk Gül" => "omer.gul@louvredigital.com" } s.platform = :ios,'7.0' - s.source = { :git => "https://github.com/omergul123/LLSimpleCamera.git", :tag => "v1.1.0" } + s.source = { :git => "https://github.com/omergul123/LLSimpleCamera.git", :tag => "v1.1.1" } s.source_files = 'LLSimpleCamera/*.{h,m}' s.requires_arc = true s.framework = 'AVFoundation' diff --git a/LLSimpleCamera/LLSimpleCamera.m b/LLSimpleCamera/LLSimpleCamera.m index 1c6391d..f9d3a68 100644 --- a/LLSimpleCamera/LLSimpleCamera.m +++ b/LLSimpleCamera/LLSimpleCamera.m @@ -126,10 +126,15 @@ - (void)changeCameraDevice:(AVCaptureDevice *)captureDevice { // stop the camera, otherwise it will lead to memory crashes - (void)stop { - AVCaptureInput* input = [self.session.inputs objectAtIndex:0]; - [self.session removeInput:input]; - AVCaptureVideoDataOutput* output = [self.session.outputs objectAtIndex:0]; - [self.session removeOutput:output]; + if(self.session.inputs.count > 0) { + AVCaptureInput* input = [self.session.inputs objectAtIndex:0]; + [self.session removeInput:input]; + } + if(self.session.outputs.count > 0) { + AVCaptureVideoDataOutput* output = [self.session.outputs objectAtIndex:0]; + [self.session removeOutput:output]; + } + [self.session stopRunning]; }