mirror of
https://github.com/telegramdesktop/tdesktop
synced 2024-12-27 09:03:02 +00:00
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;
|
||||
bool ReportingHeaderWritten = false;
|
||||
QMutex ReportingMutex;
|
||||
@ -450,6 +465,7 @@ Status Restart() {
|
||||
}
|
||||
|
||||
InstallOperatorNewHandler();
|
||||
InstallQtMessageHandler();
|
||||
|
||||
return Started;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user