diff options
Diffstat (limited to 'modules/camera')
-rw-r--r-- | modules/camera/camera_ios.mm | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/modules/camera/camera_ios.mm b/modules/camera/camera_ios.mm index c10b13b2af..e4cb928805 100644 --- a/modules/camera/camera_ios.mm +++ b/modules/camera/camera_ios.mm @@ -124,18 +124,12 @@ if (output) { [self removeOutput:output]; [output setSampleBufferDelegate:nil queue:NULL]; - [output release]; output = nil; } [self commitConfiguration]; } -- (void)dealloc { - // bye bye - [super dealloc]; -} - - (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection { // This gets called every time our camera has a new image for us to process. // May need to investigate in a way to throttle this if we get more images then we're rendering frames.. @@ -272,7 +266,6 @@ CameraFeedIOS::CameraFeedIOS() { void CameraFeedIOS::set_device(AVCaptureDevice *p_device) { device = p_device; - [device retain]; // get some info NSString *device_name = p_device.localizedName; @@ -286,14 +279,12 @@ void CameraFeedIOS::set_device(AVCaptureDevice *p_device) { }; CameraFeedIOS::~CameraFeedIOS() { - if (capture_session != NULL) { - [capture_session release]; - capture_session = NULL; + if (capture_session) { + capture_session = nil; }; - if (device != NULL) { - [device release]; - device = NULL; + if (device) { + device = nil; }; }; @@ -312,8 +303,7 @@ void CameraFeedIOS::deactivate_feed() { // end camera capture if we have one if (capture_session) { [capture_session cleanup]; - [capture_session release]; - capture_session = NULL; + capture_session = nil; }; }; @@ -347,8 +337,6 @@ void CameraFeedIOS::deactivate_feed() { // remove notifications [[NSNotificationCenter defaultCenter] removeObserver:self name:AVCaptureDeviceWasConnectedNotification object:nil]; [[NSNotificationCenter defaultCenter] removeObserver:self name:AVCaptureDeviceWasDisconnectedNotification object:nil]; - - [super dealloc]; } @end @@ -453,5 +441,5 @@ CameraIOS::CameraIOS() { }; CameraIOS::~CameraIOS() { - [device_notifications release]; + device_notifications = nil; }; |