From: sooyeon Date: Tue, 2 Nov 2021 10:40:18 +0000 (+0900) Subject: Add a checker whether quit_loop_timer is carried out or not X-Git-Tag: submit/tizen_6.5/20211112.081028~1^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=71d232e37702b6d0bfff4d98144f15d9767ef669;p=platform%2Fcore%2Fuifw%2Ftts.git Add a checker whether quit_loop_timer is carried out or not Change-Id: I2b875ea42ef0a9c5e4db1b4707639f3860a2ebc7 Signed-off-by: sooyeon --- diff --git a/server/ttsd_server.c b/server/ttsd_server.c index 8f01e230..21c3808f 100644 --- a/server/ttsd_server.c +++ b/server/ttsd_server.c @@ -51,6 +51,7 @@ typedef struct { 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; @@ -568,12 +569,18 @@ int ttsd_finalize() 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; } @@ -762,7 +769,10 @@ Eina_Bool ttsd_cleanup_client(void *data) 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; @@ -806,8 +816,12 @@ int ttsd_server_finalize(int uid) /* 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;