mirror of
https://github.com/OPM/ResInsight.git
synced 2026-08-27 13:47:12 -05:00
Add a std::set_terminate handler (manageTerminate) that runs before the stack unwinds when a C++ exception escapes the Qt event loop, so the captured stack trace points at the original throw site instead of the crash-logging plumbing reached via the SIGABRT signal handler. The handler also recovers the exception type and message via std::current_exception and reports them as crash attributes. Remove the catch-and-rethrow around the event loop in RiaMain: that handler unwound the stack to main before anything captured it, which defeated the new terminate handler. The SIGABRT signal handler remains as a fallback for direct abort()/assert() failures that do not go through std::terminate.