static int g_max_text_size = -1;
+static Ecore_Timer* g_check_state_timer = NULL;
+
+
/* for repetition */
static char* g_language = NULL;
g_language = NULL;
}
+ /* Delete state timer before destroying handle */
+ if (NULL != g_check_state_timer) {
+ ecore_timer_del(g_check_state_timer);
+ g_check_state_timer = NULL;
+ }
+
tts = NULL;
SLOG(LOG_DEBUG, TAG_TTSC, "@@@");
client->utt_id = -1;
ecore_timer_add(0, __tts_notify_error, (void*)client->tts);
- client->conn_timer = NULL;
+ if (client->conn_timer) {
+ ecore_timer_del(client->conn_timer);
+ client->conn_timer = NULL;
+ }
return EINA_FALSE;
} else if (TTS_ERROR_PERMISSION_DENIED == ret) {
client->utt_id = -1;
ecore_timer_add(0, __tts_notify_error, (void*)client->tts);
- client->conn_timer = NULL;
+ if (client->conn_timer) {
+ ecore_timer_del(client->conn_timer);
+ client->conn_timer = NULL;
+ }
return EINA_FALSE;
} else if (TTS_ERROR_NONE != ret) {
SLOG(LOG_ERROR, TAG_TTSC, "Supported options : credential(%s)", credential_needed ? "need" : "no need");
}
- client->conn_timer = NULL;
+ if (client->conn_timer) {
+ ecore_timer_del(client->conn_timer);
+ client->conn_timer = NULL;
+ }
client = tts_client_get(tts);
/* check handle */
}
ecore_thread_main_loop_begin();
+ if (client->conn_timer) {
+ ecore_timer_del(client->conn_timer);
+ client->conn_timer = NULL;
+ }
client->conn_timer = ecore_timer_add(0.02, __tts_connect_daemon, (void*)tts);
ecore_thread_main_loop_end();
}
if (NULL != client->state_changed_cb) {
- ecore_timer_add(0, __tts_notify_state_changed, client->tts);
+ if (NULL != g_check_state_timer) {
+ ecore_timer_del(g_check_state_timer);
+ g_check_state_timer = NULL;
+ }
+ g_check_state_timer = ecore_timer_add(0, __tts_notify_state_changed, client->tts);
} else {
SLOG(LOG_WARN, TAG_TTSC, "[WARNING] State changed callback is null");
}
client->state_changed_cb = NULL;
client->state_changed_user_data = NULL;
+ if (NULL != g_check_state_timer) {
+ ecore_timer_del(g_check_state_timer);
+ g_check_state_timer = NULL;
+ }
+
SLOG(LOG_DEBUG, TAG_TTSC, "[SUCCESS] Unset state changed cb");
return 0;