diff options
author | davej@chromium.org <davej@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-09 00:41:31 +0000 |
---|---|---|
committer | davej@chromium.org <davej@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-09 00:41:31 +0000 |
commit | 9be170daeed52bb8de8a661c9a770d6a846cf9b3 (patch) | |
tree | 3fef2f4c6b6ec4f4ef95f775e58d03b90f7b8a3f /chrome/browser/chromeos/audio_handler.cc | |
parent | 7173edd04a5052312f9831baab10d41c76d11f85 (diff) | |
download | chromium_src-9be170daeed52bb8de8a661c9a770d6a846cf9b3.zip chromium_src-9be170daeed52bb8de8a661c9a770d6a846cf9b3.tar.gz chromium_src-9be170daeed52bb8de8a661c9a770d6a846cf9b3.tar.bz2 |
Stop SystemKeyEventListener sooner
The worker thread created in AudioMixerAlsa should now stop and join as expected now that it is being stopped on the UI thread. Previously, AudioMixerAlsa shutdown was done when Singletons are destroyed, during AtExitManager, which happens much later and off of the UI thread.
BUG=chromium-os:11745
TEST=Manual, Crash Report - Stack Signature: -192EB7B should stop occurring
Review URL: http://codereview.chromium.org/6465002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74212 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/audio_handler.cc')
-rw-r--r-- | chrome/browser/chromeos/audio_handler.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/chrome/browser/chromeos/audio_handler.cc b/chrome/browser/chromeos/audio_handler.cc index 7e5d4b9..fd8e267 100644 --- a/chrome/browser/chromeos/audio_handler.cc +++ b/chrome/browser/chromeos/audio_handler.cc @@ -93,6 +93,10 @@ void AudioHandler::SetMute(bool do_mute) { mixer_->SetMute(do_mute); } +void AudioHandler::Disconnect() { + mixer_.reset(); +} + bool AudioHandler::TryToConnect(bool async) { if (mixer_type_ == MIXER_TYPE_PULSEAUDIO) { VLOG(1) << "Trying to connect to PulseAudio"; @@ -156,7 +160,6 @@ AudioHandler::AudioHandler() max_volume_db_(kMaxVolumeDb), min_volume_db_(kMinVolumeDb), mixer_type_(MIXER_TYPE_PULSEAUDIO) { - // Start trying to connect to mixers asychronously, starting with the current // mixer_type_. If the connection fails, another TryToConnect() for the next // mixer will be posted at that time. @@ -164,7 +167,7 @@ AudioHandler::AudioHandler() } AudioHandler::~AudioHandler() { - mixer_.reset(); + Disconnect(); }; bool AudioHandler::VerifyMixerConnection() { |