From ced4b7b1230f512b4342f7e3875cbc1e14fbe455 Mon Sep 17 00:00:00 2001 From: hyunho Date: Tue, 17 Dec 2019 10:46:23 +0900 Subject: [PATCH] Fix launching duplication bug When __launch_instance is called twice, duplicate timer will be added. Change-Id: I1267d8aa2ffda59dabb3728b8bff712c49f65626 Signed-off-by: hyunho --- widget_viewer_evas/src/widget_viewer_evas.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/widget_viewer_evas/src/widget_viewer_evas.c b/widget_viewer_evas/src/widget_viewer_evas.c index df077a4..9b0e71c 100644 --- a/widget_viewer_evas/src/widget_viewer_evas.c +++ b/widget_viewer_evas/src/widget_viewer_evas.c @@ -689,6 +689,12 @@ static void __launch_instance() return; } + if (s_info.launch_timer > 0) { + LOGW("already in launching process(%s)", + s_info.launching_instance_id); + return; + } + instance_id = s_info.launch_list->data; info = g_hash_table_lookup(s_info.widget_table, instance_id); if (info == NULL) { @@ -838,8 +844,7 @@ static int __restart_terminated_widget(const char *widget_id) } __add_launch_list(instance_id); } - if (s_info.launch_timer == 0) - __launch_instance(); + __launch_instance(); return 0; } @@ -852,6 +857,7 @@ static gboolean __launch_timeout_cb(gpointer user_data) LOGW("Timeout called !! %s", instance_id); __clear_launch_waiting(instance_id); __set_faulted(instance_id); + s_info.launch_timer = 0; __launch_instance(); return G_SOURCE_REMOVE; } @@ -1312,8 +1318,7 @@ static void __resize_cb(void *data, Evas *e, Evas_Object *layout, void *event_in */ __display_loading_text(info); __add_launch_list(info->instance_id); - if (s_info.launch_timer == 0) - __launch_instance(); + __launch_instance(); } else { /** * @note -- 2.7.4