Bug 1523920 - P2: Destroy AudioChannelAgent when error occurs. r=eeejay
authorChun-Min Chang <chun.m.chang@gmail.com>
Wed, 21 Aug 2019 20:11:27 +0000
changeset 553727 18d8187317cdc1d33de3abcf2158be990dad83f4
parent 553726 2e49430660ae20e1acecff858966effc4d851e24
child 553728 1d4911d7a26ca3a88065dc8d45e7a019825b2324
push id2165
push userffxbld-merge
push dateMon, 14 Oct 2019 16:30:58 +0000
treeherdermozilla-release@0eae18af659f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerseeejay
bugs1523920
milestone70.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1523920 - P2: Destroy AudioChannelAgent when error occurs. r=eeejay When error occurs, there is no need to use audio. Differential Revision: https://phabricator.services.mozilla.com/D35462
dom/media/webspeech/synth/nsSpeechTask.cpp
--- a/dom/media/webspeech/synth/nsSpeechTask.cpp
+++ b/dom/media/webspeech/synth/nsSpeechTask.cpp
@@ -209,16 +209,18 @@ nsSpeechTask::DispatchError(float aElaps
 
   return DispatchErrorImpl(aElapsedTime, aCharIndex);
 }
 
 nsresult nsSpeechTask::DispatchErrorImpl(float aElapsedTime,
                                          uint32_t aCharIndex) {
   LOG(LogLevel::Debug, ("nsSpeechTask::DispatchErrorImpl"));
 
+  DestroyAudioChannelAgent();
+
   MOZ_ASSERT(mUtterance);
   if (NS_WARN_IF(mUtterance->mState == SpeechSynthesisUtterance::STATE_ENDED)) {
     return NS_ERROR_NOT_AVAILABLE;
   }
 
   if (mSpeechSynthesis) {
     mSpeechSynthesis->OnEnd(this);
   }