Skip to content

Commit 4166372

Browse files
committed
core/log: Fix nullptr crash in ThreadLogging
1 parent a5431dd commit 4166372

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/core/logging.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -458,13 +458,13 @@ void ThreadLogging::onMessage(const LogMessage& msg, bool showInSparse) {
458458
}
459459

460460
if (!this->detailedWriter.write(msg) || (this->detailedFile && !this->detailedFile->flush())) {
461+
this->detailedWriter.setDevice(nullptr);
462+
461463
if (this->detailedFile) {
462464
qCCritical(logLogging) << "Detailed logger failed to write. Ending detailed logs.";
465+
this->detailedFile->close();
466+
this->detailedFile = nullptr;
463467
}
464-
465-
this->detailedWriter.setDevice(nullptr);
466-
this->detailedFile->close();
467-
this->detailedFile = nullptr;
468468
}
469469
}
470470

0 commit comments

Comments
 (0)