static Ecore_Timer* g_check_client_timer = NULL;
static Ecore_Timer* g_wait_timer = NULL;
static Ecore_Timer* g_terminate_timer = NULL;
+static Ecore_Timer* g_quit_loop_timer = NULL;
static utterance_t g_utt;
SLOG(LOG_INFO, tts_tag(), "[INFO] Delete ecore terminating timer handle");
}
- if (NULL != g_check_client_timer) {
+ if (g_check_client_timer) {
ecore_timer_del(g_check_client_timer);
g_check_client_timer = NULL;
SLOG(LOG_INFO, tts_tag(), "[INFO] Delete ecore checking client timer handle");
}
+ if (g_quit_loop_timer) {
+ ecore_timer_del(g_quit_loop_timer);
+ g_quit_loop_timer = NULL;
+ SLOG(LOG_INFO, tts_tag(), "[INFO] Delete ecore quit loop timer handle");
+ }
+
return TTSD_ERROR_NONE;
}
if (0 < ttsd_data_get_client_count()) {
ttsd_data_foreach_clients(__get_client_for_clean_up, NULL);
} else {
- ecore_timer_add(0, __quit_ecore_loop, NULL);
+ if (NULL == g_quit_loop_timer) {
+ SLOG(LOG_INFO, tts_tag(), "[Server] Add a timer __quit_ecore_loop");
+ g_quit_loop_timer = ecore_timer_add(0, __quit_ecore_loop, NULL);
+ }
SLOG(LOG_ERROR, tts_tag(), "[Server] Deleted timer");
g_check_client_timer = NULL;
return EINA_FALSE;
/* unload engine, if ref count of client is 0 */
if (0 == ttsd_data_get_client_count()) {
- SLOG(LOG_DEBUG, tts_tag(), "[Server] Quit main loop");
- ecore_timer_add(0, __quit_ecore_loop, NULL);
+ if (NULL == g_quit_loop_timer) {
+ SLOG(LOG_DEBUG, tts_tag(), "[Server] Quit main loop");
+ g_quit_loop_timer = ecore_timer_add(0, __quit_ecore_loop, NULL);
+ } else {
+ SLOG(LOG_WARN, tts_tag(), "[Server] Already called __quit_ecore_loop");
+ }
}
return TTSD_ERROR_NONE;