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 8419707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:41:11+00:00 2026-06-10T02:41:11+00:00

My application uses a camera library which shall send images to my application continuously.

  • 0

My application uses a camera library which shall send images to my application continuously. Unfortunately this library starts a thread which throws an exception (or causes an exception to be thrown) and doesn’t handle it. As a result the entire application crashes. Is there a way to prevent the application from crashing? Can I install an exception handler on a thread externally?

Some details about my specific situation: There’s no function in the call stack of the crashing thread, that I have control over. I don’t even know what exactly the thread is there for. But I stop the program with the debugger, I can tell which thread it is, that is going to crash. Unfortunately, the thread crashes very randomly, sometimes it takes more than an hour until something happens. I’m using Visual Studio C++ 2010, the debugger tells me, it’s a std::bad_alloc.

  • 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-06-10T02:41:13+00:00Added an answer on June 10, 2026 at 2:41 am

    You can trap the exception by installing a callback with SetUnhandledExceptionFilter. And kill the thread when it fires.

    Nevertheless, the exception is a nasty one. The common cause for std::bad_alloc is not just running out of memory, it can also be triggered by a corrupted heap. Both are unrecoverable conditions, killing the thread doesn’t restore leaked memory and doesn’t un-corrupt the heap. Furthermore, you’ve leaked the thread’s stack by killing the thread. And the odds that you’ll get the camera going are very slight in general, it will very likely just bomb again quickly. Only consider trying this iff your program can continue to be useful without the camera.

    Running it out of process so you can afford to lose the state entirely is an option, but the process interop you’ll need it painful and relatively expensive.

    If you can’t get support from the vendor then you need to go shopping again.

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

Sidebar

Related Questions

I am building this application which uses CCTV camera for streaming feeds to an
I have this camera application that I'm working on which uses openCV for image
I am developing an Android application in 2.2, which uses Camera. Now Can anyone
I am developing an app which uses the phone's default camera application to capture
My iPhone application uses the camera to take pictures, which I suspect is somewhat
I am developing a Java ME application which uses the camera to take a
I have an application which uses the Microsoft Kinect camera device. At each point
My application uses the UIImagePicker to allow the user to use the camera and
I'm developing an augmented reality application for Android that uses the phone's camera to
My application uses a MapView which will display multiple places. I have the latitude

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.