fixed crash restart conditions

This commit is contained in:
fourtf 2019-09-22 16:14:16 +02:00
parent 431d35e528
commit f27c8eb1b4
2 changed files with 15 additions and 14 deletions

View file

@ -39,6 +39,11 @@ macx {
LIBS += -L/usr/local/lib LIBS += -L/usr/local/lib
} }
# Set C_DEBUG if it's a debug build
CONFIG(debug, debug|release) {
DEFINES += C_DEBUG
}
# Submodules # Submodules
include(lib/warnings.pri) include(lib/warnings.pri)
include(lib/appbase.pri) include(lib/appbase.pri)

View file

@ -114,16 +114,14 @@ namespace {
{ {
using namespace std::chrono_literals; using namespace std::chrono_literals;
// if (std::chrono::steady_clock::now() - signalsInitTime > 30s) if (restartOnSignal &&
// { std::chrono::steady_clock::now() - signalsInitTime > 30s)
QProcess proc; {
proc.setProgram(QApplication::applicationFilePath()); QProcess proc;
proc.setArguments({"--crash-recovery"}); proc.setProgram(QApplication::applicationFilePath());
proc.startDetached(); proc.setArguments({"--crash-recovery"});
proc.startDetached();
// QProcess::startDetached(QApplication::applicationFilePath(), }
// {"--crash-recovery"});
// }
_exit(signum); _exit(signum);
} }
@ -132,13 +130,11 @@ namespace {
// true. // true.
void initSignalHandler() void initSignalHandler()
{ {
//#if not defined(DEBUG) && not defined(_DEBUG) && not defined(NDEBUG) #ifndef C_DEBUG
signalsInitTime = std::chrono::steady_clock::now(); signalsInitTime = std::chrono::steady_clock::now();
// signal(SIGINT, handleSignal);
signal(SIGSEGV, handleSignal); signal(SIGSEGV, handleSignal);
// signal(SIGABRT_COMPAT, handleSignal); #endif
//#endif
} }
} // namespace } // namespace