1

Am trying to use the project found here, I have made some modifications and the code works okey, but sometimes it throws the below error. How can I suppress or handle that error message in code, as it stops logic flow from continuing untill the button is pressed manually

error message

after debgugging abit, I can find the error is thrown in a delete line, it tries to delete a pointer and it prints std::bad_alloc then hangs

Exorcismus
  • 2,243
  • 1
  • 35
  • 68
  • why do you think, it's related to a missing dll? – Jörg Beyer May 05 '19 at 12:26
  • @JörgBeyer, sorry, I have edited the question title – Exorcismus May 05 '19 at 12:34
  • [*What is the cause of “This application has requested the Runtime to terminate it in an unusual way”?*](https://stackoverflow.com/questions/8177152/what-is-the-cause-of-this-application-has-requested-the-runtime-to-terminate-it) - [`abort`](https://learn.microsoft.com/en-us/previous-versions/k089yyh0(v=vs.140)) – RbMm May 05 '19 at 13:07
  • I think this a crash or assertion, try running it in a debugger. – Frank Osterfeld May 05 '19 at 13:07
  • i searched the project but `abort()` is not called explicitly, it could be called in one of the DLLs am using, is a `try catch` will solve it ? – Exorcismus May 05 '19 at 13:24
  • To call `abort()` directly is unusual (although possible). Writing `assert()`s into your code, you involve potential calls to `abort()` (because this what actually is called when asserted condition doesn't hold). `try`/`catch` wouldn't help (probably) because `abort()` is often called for things which cannot be catched (like e.g. memory access errors). – Scheff's Cat May 05 '19 at 13:27
  • what options do I have to suprress this then ? – Exorcismus May 05 '19 at 14:07
  • To suppress to call of `abort()` you have to eliminate the bugs from the code of DLL which cause its call. `abort()` is usually called when fatal errors occurred (e.g. an Access Violation) or things which shouldn't happen in correct code (like in `assert()`s). – Scheff's Cat May 06 '19 at 20:28

0 Answers0