mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
fixed crash restart conditions
This commit is contained in:
parent
431d35e528
commit
f27c8eb1b4
2 changed files with 15 additions and 14 deletions
|
@ -39,6 +39,11 @@ macx {
|
|||
LIBS += -L/usr/local/lib
|
||||
}
|
||||
|
||||
# Set C_DEBUG if it's a debug build
|
||||
CONFIG(debug, debug|release) {
|
||||
DEFINES += C_DEBUG
|
||||
}
|
||||
|
||||
# Submodules
|
||||
include(lib/warnings.pri)
|
||||
include(lib/appbase.pri)
|
||||
|
|
|
@ -114,16 +114,14 @@ namespace {
|
|||
{
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
// if (std::chrono::steady_clock::now() - signalsInitTime > 30s)
|
||||
// {
|
||||
QProcess proc;
|
||||
proc.setProgram(QApplication::applicationFilePath());
|
||||
proc.setArguments({"--crash-recovery"});
|
||||
proc.startDetached();
|
||||
|
||||
// QProcess::startDetached(QApplication::applicationFilePath(),
|
||||
// {"--crash-recovery"});
|
||||
// }
|
||||
if (restartOnSignal &&
|
||||
std::chrono::steady_clock::now() - signalsInitTime > 30s)
|
||||
{
|
||||
QProcess proc;
|
||||
proc.setProgram(QApplication::applicationFilePath());
|
||||
proc.setArguments({"--crash-recovery"});
|
||||
proc.startDetached();
|
||||
}
|
||||
|
||||
_exit(signum);
|
||||
}
|
||||
|
@ -132,13 +130,11 @@ namespace {
|
|||
// true.
|
||||
void initSignalHandler()
|
||||
{
|
||||
//#if not defined(DEBUG) && not defined(_DEBUG) && not defined(NDEBUG)
|
||||
#ifndef C_DEBUG
|
||||
signalsInitTime = std::chrono::steady_clock::now();
|
||||
|
||||
// signal(SIGINT, handleSignal);
|
||||
signal(SIGSEGV, handleSignal);
|
||||
// signal(SIGABRT_COMPAT, handleSignal);
|
||||
//#endif
|
||||
#endif
|
||||
}
|
||||
} // namespace
|
||||
|
||||
|
|
Loading…
Reference in a new issue