1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-20 03:37:47 +00:00

Fix a rare crash when exiting Astra

It tries to access a destructed logger for some reason, so try to stop
doing that.
This commit is contained in:
Joshua Goins 2025-02-28 15:48:31 -05:00
parent ace25c7bd2
commit bfc95ecf37

View file

@ -90,6 +90,9 @@ Q_GLOBAL_STATIC(Logger, logger)
void handler(const QtMsgType type, const QMessageLogContext &context, const QString &message) void handler(const QtMsgType type, const QMessageLogContext &context, const QString &message)
{ {
if (!logger.exists()) {
return;
}
switch (type) { switch (type) {
case QtDebugMsg: case QtDebugMsg:
case QtInfoMsg: case QtInfoMsg:
@ -107,4 +110,4 @@ void initializeLogging()
{ {
logger()->initialize(); logger()->initialize();
qInstallMessageHandler(handler); qInstallMessageHandler(handler);
} }