From e3eaf44ccf0325b89ddaf4ba244f2eeaa305f8d5 Mon Sep 17 00:00:00 2001 From: "braveyao@webrtc.org" Date: Wed, 11 Jan 2012 03:07:52 +0000 Subject: [PATCH] one logical enhancement in CoreAudio error handler. It should never happen, but so far the only suspect to a rare crash report. Review URL: http://webrtc-codereview.appspot.com/349002 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1382 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../main/source/win/audio_device_core_win.cc | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/modules/audio_device/main/source/win/audio_device_core_win.cc b/src/modules/audio_device/main/source/win/audio_device_core_win.cc index ab752b681..865cb6c54 100644 --- a/src/modules/audio_device/main/source/win/audio_device_core_win.cc +++ b/src/modules/audio_device/main/source/win/audio_device_core_win.cc @@ -4160,15 +4160,18 @@ Exit: if (keepRecording) { - hr = _ptrClientIn->Stop(); - if (FAILED(hr)) + if (_ptrClientIn != NULL) { - _TraceCOMError(hr); - } - hr = _ptrClientIn->Reset(); - if (FAILED(hr)) - { - _TraceCOMError(hr); + hr = _ptrClientIn->Stop(); + if (FAILED(hr)) + { + _TraceCOMError(hr); + } + hr = _ptrClientIn->Reset(); + if (FAILED(hr)) + { + _TraceCOMError(hr); + } } // Trigger callback from module process thread