| Index: media/audio/audio_system.cc
|
| diff --git a/media/audio/audio_system.cc b/media/audio/audio_system.cc
|
| index 953be40caa007d0ede558a8faef95d2e2babc6ab..1d082ae5686b99c677a5871845ab02ccc35f16a5 100644
|
| --- a/media/audio/audio_system.cc
|
| +++ b/media/audio/audio_system.cc
|
| @@ -3,11 +3,26 @@
|
| // found in the LICENSE file.
|
|
|
| #include "media/audio/audio_system.h"
|
| +#include "base/single_thread_task_runner.h"
|
|
|
| namespace media {
|
|
|
| static AudioSystem* g_last_created = nullptr;
|
|
|
| +void AudioSystem::OnAudioThreadDeleter::operator()(
|
| + const AudioSystem* instance) const {
|
| + CHECK(instance);
|
| + AudioSystem::ClearInstance(instance);
|
| +
|
| + if (instance->GetTaskRunner()->BelongsToCurrentThread()) {
|
| + delete instance;
|
| + return;
|
| + }
|
| + if (!instance->GetTaskRunner()->DeleteSoon(FROM_HERE, instance)) {
|
| + LOG(WARNING) << "Failed to delete AudioManager instance.";
|
| + }
|
| +}
|
| +
|
| AudioSystem::~AudioSystem() {}
|
|
|
| AudioSystem* AudioSystem::Get() {
|
|
|