RtcEventLogOutputFile needs to reset file_ whenever the file is not successfully opened

RtcEventLogOutputFile needs to reset file_ whenever the file is not successfully opened. (The destructor DCHECKs that file_ only exists if it's active, so as to help maintain this.)

Bug: webrtc:8111
Change-Id: I9a375a142af821b3c7183032f0b5d4d612dfa6b8
Reviewed-on: https://webrtc-review.googlesource.com/8080
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20229}
This commit is contained in:
Elad Alon 2017-10-10 17:23:53 +02:00 committed by Commit Bot
parent ebe36efad7
commit 03967cd7bf

View File

@ -55,8 +55,8 @@ RtcEventLogOutputFile::RtcEventLogOutputFile(rtc::PlatformFile file,
// and needs to be closed.
if (!rtc::ClosePlatformFile(file)) {
LOG(LS_ERROR) << "Can't close file.";
file_.reset();
}
file_.reset();
return;
}