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:
parent
ace25c7bd2
commit
bfc95ecf37
1 changed files with 4 additions and 1 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue