Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6778051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:13:14+00:00 2026-05-26T16:13:14+00:00

I have an application which takes some pictures. My whole application is based on

  • 0

I have an application which takes some pictures.
My whole application is based on the AVCam sample code from WWDC 2010.
I’ve messed with it a lot and yet, up until now I can’t figure out how to release the camera view properly which releases the camera session…

All i’m trying to do is the following:

  • Open camera view controller
  • Take some photos
  • Close camera view Controller
  • Open it again

The second time I push the viewController the session is lost, preview is not available and capturing is not available as well. I’ve published full example code on github.

My workaround for the issue was not to release the camera at all so the Camera View Controller acts as a Singleton, which I think is not the right way. moreover, with this behavior I couldn’t figure out a way to support camera when application went to the background (phone call for example).

Please advice. How do I destruct the camera session? and is it important to do so?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T16:13:15+00:00Added an answer on May 26, 2026 at 4:13 pm

    I’ve added the following message to AVCamCaptureManager

    - (void) destroySession {
    
        if ([delegate respondsToSelector:@selector(captureManagerSessionWillEnd:)]) {
            [delegate captureManagerSessionWillEnd:self];
        }
    
        // remove the device inputs
        [session removeInput:[self videoInput]];
        [session removeInput:[self audioInput]];
    
        // release
        [session release];
    
        // remove AVCamRecorder
        [recorder release];
    
        if ([delegate respondsToSelector:@selector(captureManagerSessionEnded:)]) {
            [delegate captureManagerSessionEnded:self];
        }
    }
    

    I’m calling destroySession when the viewController holding the camera get close (on my example it’s -closeCamera: of AVCamViewController).

    For the full working example, you’re welcome to download AVCam-CameraReleaseTest on github.com

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application which takes a string value of the form %programfiles%\directory\tool.exe from
I have an application that uses pictures, audio and some text from .txt... The
I have SMS based survey application which takes in a survey domain, and a
I have a simple WebView application which takes some time to load up when
We are developing an application which takes audio from the microphone and does some
I have an application which takes time to load so i would like to
I have built an application which takes photos when you touch the preview. I
I have a simple application which takes a text and password, generates a text
I have an application which extracts data from an XML file using XPath. If
In my application i am uploading some images to the servelet, which takes some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.