Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit adad03d

Browse files
authored
logging: use static stream in LogToFileRotate (#718)
We initialized the stream to write to in LogToFileRotate() but it got deinitialized on the exit from the scope while its reference remained in the logging which causes a crash on the first write. That's a quick fix. More appropriately would be to change webrtc function prototype for it to accept stream for the ref count increment. Signed-off-by: Dmitry Rogozhkin <[email protected]>
1 parent 84ab28f commit adad03d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

talk/owt/sdk/base/logging.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ void Logging::LogToConsole(LoggingSeverity severity) {
3737
}
3838
void Logging::LogToFileRotate(LoggingSeverity severity, std::string& dir, size_t max_log_size) {
3939
min_severity_ = severity;
40-
std::shared_ptr<rtc::CallSessionFileRotatingLogSink> log_sink =
40+
static std::shared_ptr<rtc::CallSessionFileRotatingLogSink> log_sink =
4141
std::make_shared<rtc::CallSessionFileRotatingLogSink>(dir, max_log_size);
4242
log_sink->Init();
4343
rtc::LogMessage::AddLogToStream(log_sink.get(), logging_severity_map[static_cast<int>(severity)]);

0 commit comments

Comments
 (0)