Skip to content

Commit

Permalink
dfatal fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiud committed Feb 5, 2024
1 parent 8d20936 commit 8d2b59b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/glog/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -1333,7 +1333,7 @@ class GLOG_EXPORT LogMessage {
LogMessage(const char* file, int line,
const logging::internal::CheckOpString& result);

~LogMessage();
~LogMessage() noexcept(false);

// Flush a buffered message to the sink set in the constructor. Always
// called by the destructor, it may also be called from elsewhere if
Expand Down
8 changes: 6 additions & 2 deletions src/logging.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1723,8 +1723,9 @@ const char* LogMessage::fullname() const noexcept { return data_->fullname_; }
const char* LogMessage::basename() const noexcept { return data_->basename_; }
const LogMessageTime& LogMessage::time() const noexcept { return time_; }

LogMessage::~LogMessage() {
LogMessage::~LogMessage() noexcept(false) {
Flush();
bool fail = data_->severity_ == GLOG_FATAL && exit_on_dfatal;
#ifdef GLOG_THREAD_LOCAL_STORAGE
if (data_ == static_cast<void*>(&thread_msg_data)) {
data_->~LogMessageData();
Expand All @@ -1735,7 +1736,10 @@ LogMessage::~LogMessage() {
#else // !defined(GLOG_THREAD_LOCAL_STORAGE)
delete allocated_;
#endif // defined(GLOG_THREAD_LOCAL_STORAGE)
}
if (fail) {
Fail();
}
}

int LogMessage::preserved_errno() const { return data_->preserved_errno_; }

Expand Down

0 comments on commit 8d2b59b

Please sign in to comment.