Merge change 23300 into eclair

* changes:
  Add a synchronous stop method to TTS synth engine so that upon its destruction, if it was synthesing to a file, the latter can be deleted without still being written to. Clear the hashmap of SpeechItem to be stopped (mKillList) when the speech queue is empty.
diff --git a/libs/audioflinger/AudioFlinger.cpp b/libs/audioflinger/AudioFlinger.cpp
index 77a126c..3a419b5 100644
--- a/libs/audioflinger/AudioFlinger.cpp
+++ b/libs/audioflinger/AudioFlinger.cpp
@@ -136,8 +136,17 @@
 
 AudioFlinger::~AudioFlinger()
 {
-    mRecordThreads.clear();
-    mPlaybackThreads.clear();
+    while (!mRecordThreads.isEmpty()) {
+        // closeInput() will remove first entry from mRecordThreads
+        closeInput(mRecordThreads.keyAt(0));
+    }
+    while (!mPlaybackThreads.isEmpty()) {
+        // closeOutput() will remove first entry from mPlaybackThreads
+        closeOutput(mPlaybackThreads.keyAt(0));
+    }
+    if (mAudioHardware) {
+        delete mAudioHardware;
+    }
 }