We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 860d085 commit 4776c4dCopy full SHA for 4776c4d
onnxruntime/core/common/logging/logging.cc
@@ -65,8 +65,11 @@ LoggingManager* LoggingManager::GetDefaultInstance() {
65
#endif
66
67
static std::mutex& DefaultLoggerMutex() noexcept {
68
- static std::mutex mutex;
69
- return mutex;
+ // Use dynamically allocated mutex to avoid destruction order issues.
+ // The mutex is intentionally never deleted to ensure it remains valid
70
+ // during static destruction when LoggingManager destructor may be called.
71
+ static std::mutex* mutex = new std::mutex();
72
+ return *mutex;
73
}
74
75
Logger* LoggingManager::s_default_logger_ = nullptr;
0 commit comments