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

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: 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..d608a5d31e5dce6dd3e84b9b8e56214695b60e42 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;
+ // WebRtcAudioRenderer::Stop() will trigger RemoveAudioRenderer(), so we
henrika (OOO until Aug 14) 2013/05/27 10:06:00 I am stupid, but the example says: { // scope
henrika (OOO until Aug 14) 2013/05/27 10:11:21 OK, checking the swap implementation it looks like
+ // have to swap the member reference to a local reference here.
+ scoped_refptr<WebRtcAudioRenderer> renderer;
+ renderer_.swap(renderer);
tommi (sloooow) - chröme 2013/05/27 10:48:13 I don't think swap() is the right thing here becau
no longer working on chromium 2013/05/27 11:15:41 Done.
+ renderer->Stop();
}
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