From c68b18d6d55644a6b5e550a6db352be1491a0d01 Mon Sep 17 00:00:00 2001 From: "sooyeon.kim" Date: Fri, 16 Jun 2017 19:45:46 +0900 Subject: [PATCH 1/1] Fix ecore timer of error cb Change-Id: I3944d63256bc2907da51b4f9bf2e2589db295553 Signed-off-by: sooyeon.kim (cherry picked from commit 27612f966d347df9f42c93c6d328b65a971801b3) --- client/stt.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/client/stt.c b/client/stt.c index 6ad5d1a..fe24360 100644 --- a/client/stt.c +++ b/client/stt.c @@ -35,7 +35,7 @@ static void __stt_notify_state_changed(void *data); -static Eina_Bool __stt_notify_error(void *data); +static void __stt_notify_error(void *data); static Ecore_Timer* g_connect_timer = NULL; static float g_volume_db = 0; @@ -950,7 +950,7 @@ static Eina_Bool __stt_connect_daemon(void *data) SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to initialize : %s", __stt_get_error_code(ret)); client->reason = STT_ERROR_ENGINE_NOT_FOUND; - ecore_timer_add(0, __stt_notify_error, (void*)client); + ecore_main_loop_thread_safe_call_async(__stt_notify_error, (void*)client); return EINA_FALSE; @@ -1856,7 +1856,7 @@ int stt_foreach_detailed_result(stt_h stt, stt_result_time_cb callback, void* us return ret; } -static Eina_Bool __stt_notify_error(void *data) +static void __stt_notify_error(void *data) { stt_client_s* client = (stt_client_s*)data; @@ -1865,11 +1865,11 @@ static Eina_Bool __stt_notify_error(void *data) /* check handle */ if (NULL == client) { SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to notify error : A handle is not valid"); - return EINA_FALSE; + return; } if (NULL == stt_client_get_by_uid(client->uid)) - return EINA_FALSE; + return; if (NULL != client->error_cb) { stt_client_use_callback(client); @@ -1882,7 +1882,7 @@ static Eina_Bool __stt_notify_error(void *data) SLOG(LOG_WARN, TAG_STTC, "[WARNING] Error callback is null"); } - return EINA_FALSE; + return; } int __stt_cb_error(int uid, int reason, char* err_msg) @@ -1913,7 +1913,7 @@ int __stt_cb_error(int uid, int reason, char* err_msg) SLOG(LOG_INFO, TAG_STTC, "internal state is initialized to 0"); if (NULL != data->error_cb) { - ecore_timer_add(0, __stt_notify_error, data); + ecore_main_loop_thread_safe_call_async(__stt_notify_error, data); } else { SLOG(LOG_WARN, TAG_STTC, "[WARNING] Error callback is null"); } @@ -1950,7 +1950,7 @@ int __stt_cb_error(int uid, int reason, char* err_msg) SLOG(LOG_INFO, TAG_STTC, "internal state is initialized to 0"); if (NULL != client->error_cb) { - ecore_timer_add(0, __stt_notify_error, client); + ecore_main_loop_thread_safe_call_async(__stt_notify_error, client); } else { SLOG(LOG_WARN, TAG_STTC, "[WARNING] Error callback is null"); } -- 2.7.4