Skip to content

Commit

Permalink
need extra retains on these, else causes memory crashes.
Browse files Browse the repository at this point in the history
  • Loading branch information
clayallsopp committed Jul 9, 2012
1 parent e0ebaf6 commit e464652
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions motion/core/device/camera.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ module Error

def self.front
return nil if not UIImagePickerController.isCameraDeviceAvailable(UIImagePickerControllerCameraDeviceFront)
Camera.new(:front)
Camera.new(:front).retain
end

def self.rear
return nil if not UIImagePickerController.isCameraDeviceAvailable(UIImagePickerControllerCameraDeviceRear)
Camera.new(:rear)
Camera.new(:rear).retain
end

# For uploading photos from the library.
def self.any
Camera.new
Camera.new.retain
end

def initialize(location = :none)
Expand Down

0 comments on commit e464652

Please sign in to comment.