Skip to content

Commit f7597cd

Browse files
ItzDerockoutfoxxed
authored andcommitted
core/log: fix nullptr crash in ThreadLogging
1 parent 42420ea commit f7597cd

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) {
464+
this->detailedFile->close();
465+
this->detailedFile = nullptr;
462466
qCCritical(logLogging) << "Detailed logger failed to write. Ending detailed logs.";
463467
}
464-
465-
this->detailedWriter.setDevice(nullptr);
466-
this->detailedFile->close();
467-
this->detailedFile = nullptr;
468468
}
469469
}
470470

0 commit comments

Comments
 (0)