From ac08d523b9e6c203de53951aaa138eed4ed63e55 Mon Sep 17 00:00:00 2001 From: Wonnam Jang Date: Wed, 28 Nov 2018 19:59:54 +0900 Subject: [PATCH] Remove unnecessary timer Change-Id: I6f56f5eda8db76a3cea0d9a055bd0c78a3622ca4 Signed-off-by: Wonnam Jang --- client/tts.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/client/tts.c b/client/tts.c index ac20eb3..f5a44f3 100644 --- a/client/tts.c +++ b/client/tts.c @@ -638,7 +638,10 @@ static Eina_Bool __tts_connect_daemon(void *data) 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) { @@ -648,7 +651,10 @@ static Eina_Bool __tts_connect_daemon(void *data) 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) { @@ -661,7 +667,10 @@ static Eina_Bool __tts_connect_daemon(void *data) 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 */ @@ -711,6 +720,10 @@ int tts_prepare(tts_h tts) } 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(); -- 2.7.4