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

Unified Diff: webrtc/video/video_send_stream.cc

Issue 1815733002: Fixing crash that may occur after destroying a VideoSendStream. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/video_send_stream.cc
diff --git a/webrtc/video/video_send_stream.cc b/webrtc/video/video_send_stream.cc
index 21a22dc9143203aaf075f2bab2adfe13a7029442..555b68c94d6ef47e5fa371e4533fd3e123c07c85 100644
--- a/webrtc/video/video_send_stream.cc
+++ b/webrtc/video/video_send_stream.cc
@@ -449,7 +449,6 @@ VideoSendStream::VideoSendStream(
VideoSendStream::~VideoSendStream() {
LOG(LS_INFO) << "~VideoSendStream: " << config_.ToString();
- bitrate_allocator_->RemoveObserver(this);
Stop();
// Stop the encoder thread permanently.
@@ -457,6 +456,10 @@ VideoSendStream::~VideoSendStream() {
encoder_wakeup_event_.Set();
encoder_thread_.Stop();
+ // This needs to happen after stopping the encoder thread,
+ // since the encoder thread calls AddObserver.
+ bitrate_allocator_->RemoveObserver(this);
+
module_process_thread_->DeRegisterModule(&overuse_detector_);
vie_channel_.RegisterSendFrameCountObserver(nullptr);
vie_channel_.RegisterSendBitrateObserver(nullptr);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698