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

Unified Diff: content/renderer/media/audio_input_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
« no previous file with comments | « no previous file | content/renderer/media/audio_message_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/audio_input_message_filter.cc
diff --git a/content/renderer/media/audio_input_message_filter.cc b/content/renderer/media/audio_input_message_filter.cc
index b523ac6d9ce398f0a99f1dd0fd8c9ee5d1804705..850cd1a0fa57c49bf06deb2a41c32a654df4f773 100644
--- a/content/renderer/media/audio_input_message_filter.cc
+++ b/content/renderer/media/audio_input_message_filter.cc
@@ -22,6 +22,11 @@ AudioInputMessageFilter::AudioInputMessageFilter()
AudioInputMessageFilter::~AudioInputMessageFilter() {
DVLOG(1) << "AudioInputMessageFilter::~AudioInputMessageFilter()";
+
+ // Just in case the message filter is deleted before the channel
+ // is closed and there are still living audio devices.
+ OnChannelClosing();
+
DCHECK_EQ(filter_, this);
filter_ = NULL;
}
@@ -83,6 +88,7 @@ void AudioInputMessageFilter::OnChannelClosing() {
IDMap<media::AudioInputIPCDelegate>::iterator it(&delegates_);
while (!it.IsAtEnd()) {
it.GetCurrentValue()->OnIPCClosed();
+ delegates_.Remove(it.GetCurrentKey());
it.Advance();
}
}
« no previous file with comments | « no previous file | content/renderer/media/audio_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698