OSDN Git Service

Merge change 20673 into donut
authorAndroid (Google) Code Review <android-gerrit@google.com>
Tue, 11 Aug 2009 22:18:29 +0000 (15:18 -0700)
committerAndroid (Google) Code Review <android-gerrit@google.com>
Tue, 11 Aug 2009 22:18:29 +0000 (15:18 -0700)
commit012bb4d4e59e50f39fd199db89b4a4be93c7ad50
tree9c834f296fdf8bb941e2f8da5b6dd53534276ebc
parent90a23aa50a94a82b64fc76d19db13db93411d635
parent3d3c180d51af916cb67872630f7ff76e7fb99458
Merge change 20673 into donut

* changes:
  Fix bug 2043140. A race condition is encountered when an application invokes shutdown() on its TextToSpeech object while is has speak() requests still running. Since the TTS service destructor releases the synthesizer resources and sets the corresponding synth reference to null, an NPE was observed. The fix consists in catching NPEs whenever the sNativeSynth object is accessed, and return the matching error for the call. This change is a "low risk" version of the fix for bug 2025765i (same issue) which was reverted because it was higher risk than this CL: it affected the logic of each call to sNativeSynth. This CL only sets an error code when an NPE is fired because sNativeSynth is null.