From 019d6cc53aeac3aa072f4519532c03065ef0fbc7 Mon Sep 17 00:00:00 2001 From: James Turner Date: Sun, 4 Apr 2021 16:34:46 +0100 Subject: [PATCH] Launcher: tweak how Qt Fatal log messages are handled --- src/GUI/QtLauncher.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/GUI/QtLauncher.cxx b/src/GUI/QtLauncher.cxx index 503d39d8e..ee255ce7c 100644 --- a/src/GUI/QtLauncher.cxx +++ b/src/GUI/QtLauncher.cxx @@ -333,7 +333,10 @@ static void simgearMessageOutput(QtMsgType type, const QMessageLogContext &conte // important we copy the file name here, since QMessageLogContext doesn't sglog().logCopyingFilename(SG_GUI, mappedPriority, file, context.line, "" /*function*/, s); if (type == QtFatalMsg) { - abort(); + // if we abort() here, we get a thread crash which prevents + // us actually seeing the error + // we'll attempt to continue so we do the SG_POPUP dialog, maybe it works + // if it crashes we're no worse off than calling abort() here } } @@ -355,7 +358,7 @@ static std::unique_ptr static_qApp; void selectUITranslation() { QStringList uiLanguages = QLocale::system().uiLanguages(); - qWarning() << "UI languages:" << uiLanguages; + //qWarning() << "UI languages:" << uiLanguages; for (QString locale : qAsConst(uiLanguages)) { // remove script if it exists, eg zh-Hans-CN -> zh-CN