std::list<speak_data_s*>::iterator iter = g_app_list[index].m_speak_data.begin();
*data = *iter;
- g_app_list[index].m_speak_data.pop_front();
+ if (!g_app_list[index].m_speak_data.empty())
+ g_app_list[index].m_speak_data.pop_front();
#ifdef DATA_DEBUG
__data_show_text_list(index);
std::list<sound_data_s*>::iterator iter = g_app_list[index].m_wav_data.begin();
*data = *iter;
- g_app_list[index].m_wav_data.pop_front();
+ if (!g_app_list[index].m_wav_data.empty())
+ g_app_list[index].m_wav_data.pop_front();
#ifdef DATA_DEBUG
__data_show_sound_list(index);
}
}
- /* mutex is locked */
- pthread_mutex_lock(&g_sound_data_mutex);
-
+ pthread_mutex_lock(&g_speak_data_mutex);
g_app_list[index].m_speak_data.clear();
- g_app_list[index].m_wav_data.clear();
+ pthread_mutex_unlock(&g_speak_data_mutex);
- /* mutex is unlocked */
+ pthread_mutex_lock(&g_sound_data_mutex);
+ g_app_list[index].m_wav_data.clear();
pthread_mutex_unlock(&g_sound_data_mutex);
return TTSD_ERROR_NONE;