From: Ji-hoon Lee Date: Wed, 22 Nov 2023 13:36:35 +0000 (+0900) Subject: Make sure to delete retry_connection timer on unprepare() call X-Git-Tag: accepted/tizen/unified/20240129.163405^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9570d629abe147b305655f83bdf0f3a67b737ee6;p=platform%2Fcore%2Fuifw%2Fmulti-assistant.git Make sure to delete retry_connection timer on unprepare() call Change-Id: Id9620d48fc893c08b79acb55516f87ee6299c3dc --- diff --git a/client/ma.c b/client/ma.c index 37e1a6e..67d0916 100644 --- a/client/ma.c +++ b/client/ma.c @@ -457,6 +457,7 @@ static Eina_Bool retry_connection(void* data) //LCOV_EXCL_START static void delete_retry_connection_timer(void* data) { + MA_SLOGE("[ENTER] %p", g_retry_connection_timer); //LCOV_EXCL_LINE if (g_retry_connection_timer) { ecore_timer_del(g_retry_connection_timer); g_retry_connection_timer = NULL; @@ -468,13 +469,14 @@ static void add_retry_connection_timer(void* data) delete_retry_connection_timer(NULL); g_retry_connection_timer = ecore_timer_add(1.5f, retry_connection, NULL); - MA_SLOGI("Added timer for retry_connection : %p", g_retry_connection_timer); //LCOV_EXCL_LINE + MA_SLOGE("Added timer for retry_connection : %p", g_retry_connection_timer); //LCOV_EXCL_LINE } //LCOV_EXCL_STOP static void __start_prepare_func() { if (ECORE_CALLBACK_RENEW == retry_connection(NULL)) { + MA_SLOGI("Adding timer for retry_connection"); //LCOV_EXCL_LINE ecore_main_loop_thread_safe_call_async(add_retry_connection_timer, NULL); } } @@ -512,13 +514,14 @@ int ma_unprepare(void) int ret = MA_ERROR_NONE; ma_state_e state; ret = __ma_validate_client(true, true, &state); - if (MA_ERROR_INVALID_STATE == ret) { - MA_SLOGD("Deleting timer for retry_connection"); //LCOV_EXCL_LINE - ecore_main_loop_thread_safe_call_async(delete_retry_connection_timer, NULL); - } else if (MA_ERROR_NONE != ret) { + if (MA_ERROR_NONE != ret) { + MA_SLOGE("ret : %d", ret); return ret; } + MA_SLOGI("Deleting timer for retry_connection"); //LCOV_EXCL_LINE + ecore_main_loop_thread_safe_call_async(delete_retry_connection_timer, NULL); + /* check state */ if (state != MA_STATE_READY) { MA_SLOGE("[ERROR] Invalid State: Current state is not 'READY' (%d)", state); //LCOV_EXCL_LINE