Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Detect when application crashes
I want to know if there is a way to detect or handle application crashes.
For example what if the application is to change some system settings only when it is open and has to change it back to how it was when closing, how to ensure that if the application finishes unexpectedly?
wrosecrans last edited by
Have a separate process that executes the "real" process. If it returns anything other than EXIT_SUCCESS, it crashed, and you can try to handle it as best you can.
Have a separate process that executes the "real" process
Can you elaborate more on that?
gde23 last edited by
As wrosecrans suggested you can have two executables, and the second one is watching if the first one is still running.
So the user starts the watcher, there the main process is started (you can use QProcess for that) and when it crashes the watcher can do something.
sdfdfg Banned last edited by
This post is deleted!
Thanks, I will try that