From bf415088074e7a5ef39c80db7dde3925d8c850a6 Mon Sep 17 00:00:00 2001 From: "stefan@webrtc.org" Date: Thu, 29 Nov 2012 09:18:53 +0000 Subject: [PATCH] Properly remove the bitrate observer when ViEEncoder is destructed. BUG=1090 Review URL: https://webrtc-codereview.appspot.com/969013 git-svn-id: http://webrtc.googlecode.com/svn/trunk@3196 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/video_engine/vie_encoder.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/webrtc/video_engine/vie_encoder.cc b/webrtc/video_engine/vie_encoder.cc index 36ad86258..b63cdbd4c 100644 --- a/webrtc/video_engine/vie_encoder.cc +++ b/webrtc/video_engine/vie_encoder.cc @@ -210,6 +210,9 @@ ViEEncoder::~ViEEncoder() { WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo, ViEId(engine_id_, channel_id_), "ViEEncoder Destructor 0x%p, engine_id: %d", this, engine_id_); + if (bitrate_controller_) { + bitrate_controller_->RemoveBitrateObserver(bitrate_observer_.get()); + } module_process_thread_.DeRegisterModule(&vcm_); module_process_thread_.DeRegisterModule(&vpm_); module_process_thread_.DeRegisterModule(default_rtp_rtcp_.get());