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

  • Home
  • SEARCH
  • 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 5938397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:40:47+00:00 2026-05-22T15:40:47+00:00

Investigation with the allocations performance tool shows that AVCaptureSessions are being allocated and never

  • 0

Investigation with the allocations performance tool shows that AVCaptureSessions are being allocated and never released in BarcodePickerController:viewWillAppear in the RedLaser SDK.

BarcodePickerController *_barcodeScanner = [[BarcodePickerController alloc] init];

[_barcodeScanner viewDidLoad];

//[_barcodeScanner viewWillAppear:NO]; // Option 1.
//[_barcodeScanner viewDidAppear:NO]; // Option 1.

[_barcodeScanner stopScanning];

for (int i = 0; i < 200; i++) {
    NSLog(@"Run:%d", i);
    //[_barcodeScanner resumeScanning]; // Option 1.
    //[_barcodeScanner stopScanning]; // Option 1.

    [_barcodeScanner viewWillAppear:NO]; // Option 2.
    [_barcodeScanner viewDidAppear:NO];  // Option 2.
    [_barcodeScanner viewWillDisappear:NO]; // Option 2.
    [_barcodeScanner viewDidDisappear:NO]; // Option 2.
}

//[_barcodeScanner viewWillDisappear:NO]; // Option 1.
//[_barcodeScanner viewDidDisappear:NO]; // Option 1.

[_barcodeScanner viewDidUnload];

[_barcodeScanner release];

The background is that I am writing an application with two AVCaptureSessions. One is created and managed by red laser as shown in the above sample code while the other is created by myself manually. I need to use option 2 as shown in the above code rather than option 1 to work around another bug where autofocus stops working in the capture session that is created second (be it my one or red lasers).

The only work around I have found for the autofocus bug is to recreate the capture sessions entirely rather than just starting and stopping them. I can do this with the red laser sdk as shown in option 2 above, but this eventually leads to my app being killed after a certain number of transitions between the sessions and receiving memory warnings. This occurs due to the fact that the AVCaptureSessions are not being cleaned up.

I don’t have any memory warnings or leaks when using option 1.

How can these wayward AVCaptureSessions be cleaned up?

  • 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-22T15:40:48+00:00Added an answer on May 22, 2026 at 3:40 pm

    RedLaser technical support have confirmed that this is a bug in their SDK 2.X. Their technical support and myself have confirmed that the bug is fixed in version 3 of the SDK.

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

Sidebar

Related Questions

The test driven development guys refer to a quick, exploratory, investigation that involves coding
I'm writing an identi.ca client, and seems that @reply isn't working. After investigation I
During investigation of some problem I found that the reason was unexpected different conversion
I have problem uploading with primefaces upload widget. After some investigation I noticed that
On further investigation I have discovered that there is something in my CSS that
After a bit of investigation, I found that C++0x stores the elements in a
Anyone know likely avenues of investigation for kernel launch failures that disappear when run
I have a table 'comment', investigation that has a field referencing another table 'sf_guard_user'.
Previous investigation in Can I make a table of String + lambdas that have
I have this task that needs investigation as to why the md5 value of

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.