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

Unified Diff: content/renderer/media/webrtc_audio_device_impl.cc

Issue 15732021: swap the renderer_ reference to local before calling Stop() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed Tommi's comment. Created 7 years, 7 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: content/renderer/media/webrtc_audio_device_impl.cc
diff --git a/content/renderer/media/webrtc_audio_device_impl.cc b/content/renderer/media/webrtc_audio_device_impl.cc
index e65ca33607c39abedb1e600fb9e10f2148df403b..cf4a6448350668ec20a8d35cae57dd9bc83e15bf 100644
--- a/content/renderer/media/webrtc_audio_device_impl.cc
+++ b/content/renderer/media/webrtc_audio_device_impl.cc
@@ -259,8 +259,11 @@ int32_t WebRtcAudioDeviceImpl::Terminate() {
// It is necessary to stop the |renderer_| before going away.
if (renderer_) {
- renderer_->Stop();
- renderer_ = NULL;
+ // Grab a local reference while we call Stop(), which will trigger a call to
+ // RemoveAudioRenderer that clears our reference to the audio renderer.
+ scoped_refptr<WebRtcAudioRenderer> local_renderer(renderer_);
+ local_renderer->Stop();
+ DCHECK(!renderer_);
}
if (capturer_) {
« 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