Make sure to delete retry_connection timer on unprepare() call 78/301778/1 accepted/tizen_unified_toolchain accepted/tizen/unified/20240129.163405 accepted/tizen/unified/toolchain/20240311.065800 accepted/tizen/unified/x/20240205.063925
authorJi-hoon Lee <dalton.lee@samsung.com>
Wed, 22 Nov 2023 13:36:35 +0000 (22:36 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Wed, 22 Nov 2023 13:36:38 +0000 (22:36 +0900)
Change-Id: Id9620d48fc893c08b79acb55516f87ee6299c3dc

client/ma.c

index 37e1a6e838cae6f9b890ad72af46550bc77f1b1e..67d09160676cc080e22be91d40ba2119e97b5318 100644 (file)
@@ -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