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

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

Issue 10821109: Candidate fix for a crash at shutdown when the IO thread is going away. More details in the bug rep… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Missed the input filter... damn you code duplication! Created 8 years, 5 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
Index: content/renderer/media/audio_message_filter.cc
diff --git a/content/renderer/media/audio_message_filter.cc b/content/renderer/media/audio_message_filter.cc
index ef3bd804362a822c84ed4a9980cc0bb4511f258f..dc39f63e4c15ae87dd43ab9c057bbb67960d516c 100644
--- a/content/renderer/media/audio_message_filter.cc
+++ b/content/renderer/media/audio_message_filter.cc
@@ -105,12 +105,18 @@ void AudioMessageFilter::OnChannelClosing() {
IDMap<media::AudioOutputIPCDelegate>::iterator it(&delegates_);
while (!it.IsAtEnd()) {
it.GetCurrentValue()->OnIPCClosed();
+ delegates_.Remove(it.GetCurrentKey());
it.Advance();
}
}
AudioMessageFilter::~AudioMessageFilter() {
DVLOG(1) << "AudioMessageFilter::~AudioMessageFilter()";
+
+ // Just in case the message filter is deleted before the channel
+ // is closed and there are still living audio devices.
+ OnChannelClosing();
+
DCHECK(filter_);
filter_ = NULL;
}
« no previous file with comments | « content/renderer/media/audio_input_message_filter.cc ('k') | content/renderer/media/audio_message_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698