diff options
author | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-31 22:57:39 +0000 |
---|---|---|
committer | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-31 22:57:39 +0000 |
commit | 674bf81ee9dc14aca23adafb65ecc1424ab85372 (patch) | |
tree | 6b0963a96ff2ecf7e52205870aa4cd5747957666 /media | |
parent | 48080fd30160be4918476b4533f0c1bb19637b65 (diff) | |
download | chromium_src-674bf81ee9dc14aca23adafb65ecc1424ab85372.zip chromium_src-674bf81ee9dc14aca23adafb65ecc1424ab85372.tar.gz chromium_src-674bf81ee9dc14aca23adafb65ecc1424ab85372.tar.bz2 |
Candidate fix for a crash at shutdown when the IO thread is going away. More details in the bug report.
BUG=139790
Review URL: https://chromiumcodereview.appspot.com/10821109
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149305 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r-- | media/audio/audio_input_device.cc | 6 | ||||
-rw-r--r-- | media/audio/audio_output_device.cc | 7 |
2 files changed, 9 insertions, 4 deletions
diff --git a/media/audio/audio_input_device.cc b/media/audio/audio_input_device.cc index 381af19..401042a 100644 --- a/media/audio/audio_input_device.cc +++ b/media/audio/audio_input_device.cc @@ -253,8 +253,10 @@ void AudioInputDevice::ShutDownOnIOThread() { // NOTE: |completion| may be NULL. // Make sure we don't call shutdown more than once. if (stream_id_) { - ipc_->CloseStream(stream_id_); - ipc_->RemoveDelegate(stream_id_); + if (ipc_) { + ipc_->CloseStream(stream_id_); + ipc_->RemoveDelegate(stream_id_); + } stream_id_ = 0; session_id_ = 0; diff --git a/media/audio/audio_output_device.cc b/media/audio/audio_output_device.cc index d432103..eff1a0c 100644 --- a/media/audio/audio_output_device.cc +++ b/media/audio/audio_output_device.cc @@ -142,8 +142,11 @@ void AudioOutputDevice::ShutDownOnIOThread() { if (stream_id_) { is_started_ = false; - ipc_->CloseStream(stream_id_); - ipc_->RemoveDelegate(stream_id_); + if (ipc_) { + ipc_->CloseStream(stream_id_); + ipc_->RemoveDelegate(stream_id_); + } + stream_id_ = 0; } |