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

Unified Diff: media/audio/linux/audio_manager_linux.cc

Issue 2861010: Some fixups for AudioController and unit tests (Closed)
Patch Set: fixes Created 10 years, 6 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 | « media/audio/audio_controller_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/linux/audio_manager_linux.cc
diff --git a/media/audio/linux/audio_manager_linux.cc b/media/audio/linux/audio_manager_linux.cc
index b3d21f5956308fba572b51b2f70dafdb720984d5..9fa4799fd72a8cfde34a92f2255f7bfaba42b53d 100644
--- a/media/audio/linux/audio_manager_linux.cc
+++ b/media/audio/linux/audio_manager_linux.cc
@@ -59,6 +59,12 @@ AudioManagerLinux::AudioManagerLinux()
}
AudioManagerLinux::~AudioManagerLinux() {
+ // Make sure we stop the thread first. If we let the default destructor to
+ // destruct the members, we may destroy audio streams before stopping the
+ // thread, resulting an unexpected behavior.
+ // This way we make sure activities of the audio streams are all stopped
+ // before we destroy them.
+ audio_thread_.Stop();
active_streams_.clear();
}
« no previous file with comments | « media/audio/audio_controller_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698