| Index: media/audio/audio_manager.cc
|
| diff --git a/media/audio/audio_manager.cc b/media/audio/audio_manager.cc
|
| index 4b98e36910f500ecd31402fcf2a7ffec1a277a74..e0c9fbd967cdf572e48501947fbc7b23dda23f35 100644
|
| --- a/media/audio/audio_manager.cc
|
| +++ b/media/audio/audio_manager.cc
|
| @@ -254,21 +254,20 @@ void AudioManagerDeleter::operator()(const AudioManager* instance) const {
|
| LOG(WARNING) << "Multiple instances of AudioManager detected";
|
| }
|
|
|
| -#if defined(OS_MACOSX)
|
| // If we are on Mac, tasks after this point are not executed, hence this is
|
| // the only chance to delete the audio manager (which on Mac lives on the
|
| // main browser thread instead of a dedicated audio thread). If we don't
|
| // delete here, the CoreAudio thread can keep providing callbacks, which
|
| // uses a state that is destroyed in ~BrowserMainLoop().
|
| // See http://crbug.com/623703 for more details.
|
| - DCHECK(instance->GetTaskRunner()->BelongsToCurrentThread());
|
| - delete instance;
|
| -#else
|
| + if (instance->GetTaskRunner()->BelongsToCurrentThread()) {
|
| + delete instance;
|
| + return;
|
| + }
|
| +
|
| // AudioManager must be destroyed on the audio thread.
|
| - if (!instance->GetTaskRunner()->DeleteSoon(FROM_HERE, instance)) {
|
| + if (!instance->GetTaskRunner()->DeleteSoon(FROM_HERE, instance))
|
| LOG(WARNING) << "Failed to delete AudioManager instance.";
|
| - }
|
| -#endif
|
| }
|
|
|
| // Forward declaration of the platform specific AudioManager factory function.
|
|
|