Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1838)

Unified Diff: webrtc/pc/peerconnection.cc

Issue 2682433005: Fix the Chrome crash caused by RtcEventLog (Closed)
Patch Set: Add a unit test. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/pc/peerconnectioninterface_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/peerconnection.cc
diff --git a/webrtc/pc/peerconnection.cc b/webrtc/pc/peerconnection.cc
index ba21429d8585fe1d43fe68b0f478c0a623eef89e..026ce08be65b158fba770fe86ce1ec1cf1435596 100644
--- a/webrtc/pc/peerconnection.cc
+++ b/webrtc/pc/peerconnection.cc
@@ -1555,6 +1555,7 @@ void PeerConnection::Close() {
stats_->UpdateStats(kStatsOutputLevelStandard);
session_->Close();
+ event_log_.reset();
}
void PeerConnection::OnSessionStateChange(WebRtcSession* /*session*/,
@@ -2570,10 +2571,15 @@ bool PeerConnection::ReconfigurePortAllocator_n(
bool PeerConnection::StartRtcEventLog_w(rtc::PlatformFile file,
int64_t max_size_bytes) {
+ if (!event_log_) {
+ return false;
+ }
return event_log_->StartLogging(file, max_size_bytes);
}
void PeerConnection::StopRtcEventLog_w() {
- event_log_->StopLogging();
+ if (event_log_) {
+ event_log_->StopLogging();
+ }
}
} // namespace webrtc
« no previous file with comments | « no previous file | webrtc/pc/peerconnectioninterface_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698