Bug 1247514 - Clear speech delegate when finishing speaking. r=eeejay
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Thu, 03 Mar 2016 11:14:01 +0900
changeset 325247 4b9a16cc88c2e2689dc2c9c47be8fc01ea5439da
parent 325246 e0fd2136c897db4951017586f87090bd8315122e
child 325248 68d3781deda0d4d58ec9877862830db89669b3a5
child 326925 c254f951e0ad68f047763f8e2c2fa9385b74a798
push id1128
push userjlund@mozilla.com
push dateWed, 01 Jun 2016 01:31:59 +0000
treeherdermozilla-release@fe0d30de989d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerseeejay
bugs1247514
milestone47.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 1247514 - Clear speech delegate when finishing speaking. r=eeejay After dispatched didFinishSpeaking by OS, another events may be dispatched. So I should remove speech delegate soon when didFinishSpeaking is called. MozReview-Commit-ID: nsHKJCX8MQ
dom/media/webspeech/synth/cocoa/OSXSpeechSynthesizerService.mm
--- a/dom/media/webspeech/synth/cocoa/OSXSpeechSynthesizerService.mm
+++ b/dom/media/webspeech/synth/cocoa/OSXSpeechSynthesizerService.mm
@@ -146,16 +146,17 @@ SpeechTaskCallback::OnError(uint32_t aIn
   mTask->DispatchError(GetTimeDurationFromStart(), aIndex);
 }
 
 void
 SpeechTaskCallback::OnDidFinishSpeaking()
 {
   mTask->DispatchEnd(GetTimeDurationFromStart(), mCurrentIndex);
   // no longer needed
+  [mSpeechSynthesizer setDelegate:nil];
   mTask = nullptr;
 }
 
 @interface SpeechDelegate : NSObject<NSSpeechSynthesizerDelegate>
 {
 @private
   SpeechTaskCallback* mCallback;
 }