From: hyunho Date: Fri, 19 Jul 2019 04:36:31 +0000 (+0900) Subject: Add fault handling logic for buffer timeout. X-Git-Tag: submit/tizen/20190726.020056~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F24%2F210424%2F3;p=platform%2Fcore%2Fappfw%2Fwidget-viewer.git Add fault handling logic for buffer timeout. Change-Id: I59a863d619b7882c5490cf6b317d78062fcce2fe Signed-off-by: hyunho --- diff --git a/widget_viewer_evas/src/widget_viewer_evas.c b/widget_viewer_evas/src/widget_viewer_evas.c index 7200fa2..df077a4 100644 --- a/widget_viewer_evas/src/widget_viewer_evas.c +++ b/widget_viewer_evas/src/widget_viewer_evas.c @@ -741,6 +741,23 @@ static void __launch_instance() } } +static void __set_faulted(const char *instance_id) +{ + struct widget_info *info; + + info = g_hash_table_lookup(s_info.widget_table, instance_id); + if (!info) { + aul_widget_write_log(LOG_TAG, "[%s:%d] fail to find info (%s)", + __FUNCTION__, __LINE__, instance_id); + return; + } + aul_widget_write_log(LOG_TAG, "[%s:%d] set faulted for (%s)", + __FUNCTION__, __LINE__, info->instance_id); + info->pid = -1; + info->is_faulted = true; + __display_overlay_text(info); +} + static int __clear_launch_waiting(char *instance_id) { struct widget_info *info; @@ -834,6 +851,7 @@ static gboolean __launch_timeout_cb(gpointer user_data) LOGW("Timeout called !! %s", instance_id); __clear_launch_waiting(instance_id); + __set_faulted(instance_id); __launch_instance(); return G_SOURCE_REMOVE; } @@ -957,10 +975,8 @@ static int __instance_event_cb(const char *widget_id, const char *instance_id, i event_info.error = WIDGET_ERROR_FAULT; event_info.event = WIDGET_FAULT_DEACTIVATED; smart_signal = WIDGET_SMART_SIGNAL_WIDGET_FAULTED; - info->pid = -1; info->state = WIDGET_STATE_DETACHED; - info->is_faulted = true; - __display_overlay_text(info); + __set_faulted(info->instance_id); break; case WIDGET_INSTANCE_EVENT_CREATE_ABORTED: LOGW("widget aborted (%s)", instance_id); @@ -980,9 +996,7 @@ static int __instance_event_cb(const char *widget_id, const char *instance_id, i event_info.error = err; event_info.event = WIDGET_EVENT_CREATED; smart_signal = WIDGET_SMART_SIGNAL_WIDGET_CREATE_ABORTED; - info->pid = -1; - info->is_faulted = true; - __display_overlay_text(info); + __set_faulted(info->instance_id); break; default: /* unhandled event */