From: sooyeon Date: Fri, 15 Oct 2021 11:19:45 +0000 (+0900) Subject: Add a checker whether ttse_terminate() is invoked or not X-Git-Tag: submit/tizen/20211028.101609~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b756eb6bf1b88db22eb920331db2a909e3e680ad;p=platform%2Fcore%2Fuifw%2Ftts.git Add a checker whether ttse_terminate() is invoked or not - When 'ttse_terminate' is invoked, 'ttsd_ipc_close_connection()', 'ttsd_network_finalize()', and ttsd_finalize()' are invoked repeatably. To avoid this phenomenon, we remove them from 'ttsd_terminate()'. Change-Id: Ia048cce5f884d4b3fa71f63258caf9e83e43f38d Signed-off-by: sooyeon --- diff --git a/server/ttsd_server.c b/server/ttsd_server.c index 6901f08a..cb83d416 100644 --- a/server/ttsd_server.c +++ b/server/ttsd_server.c @@ -568,10 +568,6 @@ int ttsd_terminate() ttsd_terminate_daemon(NULL); - ttsd_ipc_close_connection(); - ttsd_network_finalize(); - ttsd_finalize(); - return TTSD_ERROR_NONE; } diff --git a/server/ttse.c b/server/ttse.c index 2d514bf8..69489cab 100755 --- a/server/ttse.c +++ b/server/ttse.c @@ -30,6 +30,7 @@ #include "ttse_internal.h" static ttsd_mode_e g_tts_mode = TTSD_MODE_DEFAULT; +static bool g_is_terminated = false; const char* tts_tag() { @@ -134,6 +135,7 @@ int ttse_main(int argc, char** argv, ttse_request_callback_s *callback) bundle *b = NULL; ttsd_mode_e mode = TTSD_MODE_DEFAULT; int ret = TTSE_ERROR_NONE; + g_is_terminated = false; b = bundle_import_from_argv(argc, argv); @@ -202,6 +204,12 @@ int ttse_main(int argc, char** argv, ttse_request_callback_s *callback) int ttse_terminate() { + if (true == g_is_terminated) { + SLOG(LOG_INFO, tts_tag(), "[INFO] ttse_terminate() is already invoked."); + return TTSE_ERROR_NONE; + } + + g_is_terminated = true; ttsd_terminate(); /* Unregister vconfkey callback */