author | Eitan Isaacson <eitan@monotonous.org> |
Wed, 24 Apr 2013 09:49:35 -0700 | |
changeset 129765 | f87f14e8949faf0c40f219aeeacc00784f011918 |
parent 129764 | 5eeaecafb9896020e3ed7d9fc8ae41f6967322bb |
child 129766 | d7a0a407d1ce0ee1b774961a365aafda1ad7d7d5 |
push id | 26993 |
push user | eisaacson@mozilla.com |
push date | Wed, 24 Apr 2013 16:49:46 +0000 |
treeherder | mozilla-inbound@f87f14e8949f [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | smaug |
bugs | 864858 |
milestone | 23.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
|
--- a/content/media/webspeech/synth/nsSpeechTask.cpp +++ b/content/media/webspeech/synth/nsSpeechTask.cpp @@ -258,24 +258,26 @@ nsSpeechTask::DispatchEndImpl(float aEla NS_ENSURE_FALSE(mUtterance->mState == SpeechSynthesisUtterance::STATE_ENDED, NS_ERROR_NOT_AVAILABLE); // XXX: This should not be here, but it prevents a crash in MSG. if (mStream) { mStream->Destroy(); } + nsRefPtr<SpeechSynthesisUtterance> utterance = mUtterance; + if (mSpeechSynthesis) { mSpeechSynthesis->OnEnd(this); } - mUtterance->mState = SpeechSynthesisUtterance::STATE_ENDED; - mUtterance->DispatchSpeechSynthesisEvent(NS_LITERAL_STRING("end"), - aCharIndex, aElapsedTime, - NS_LITERAL_STRING("")); + utterance->mState = SpeechSynthesisUtterance::STATE_ENDED; + utterance->DispatchSpeechSynthesisEvent(NS_LITERAL_STRING("end"), + aCharIndex, aElapsedTime, + NS_LITERAL_STRING("")); return NS_OK; } NS_IMETHODIMP nsSpeechTask::DispatchPause(float aElapsedTime, uint32_t aCharIndex) { if (!mIndirectAudio) { NS_WARNING("Can't call DispatchPause() from a direct audio speech service");