mirror of https://github.com/procxx/kepka.git
Add custom Qt message handler for crashes.
This commit is contained in:
parent
163ee73719
commit
478eeea73e
|
@ -115,6 +115,21 @@ void InstallOperatorNewHandler() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void InstallQtMessageHandler() {
|
||||||
|
static QtMessageHandler original = nullptr;
|
||||||
|
original = qInstallMessageHandler([](
|
||||||
|
QtMsgType type,
|
||||||
|
const QMessageLogContext &context,
|
||||||
|
const QString &message) {
|
||||||
|
if (original) {
|
||||||
|
original(type, context, message);
|
||||||
|
}
|
||||||
|
if (type == QtFatalMsg) {
|
||||||
|
Unexpected("Qt FATAL message was generated!");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
Qt::HANDLE ReportingThreadId = nullptr;
|
Qt::HANDLE ReportingThreadId = nullptr;
|
||||||
bool ReportingHeaderWritten = false;
|
bool ReportingHeaderWritten = false;
|
||||||
QMutex ReportingMutex;
|
QMutex ReportingMutex;
|
||||||
|
@ -450,6 +465,7 @@ Status Restart() {
|
||||||
}
|
}
|
||||||
|
|
||||||
InstallOperatorNewHandler();
|
InstallOperatorNewHandler();
|
||||||
|
InstallQtMessageHandler();
|
||||||
|
|
||||||
return Started;
|
return Started;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue