Fix del_cb widget info clear bug 91/144891/2 submit/tizen_3.0/20170818.103300
authorHyunho Kang <hhstark.kang@samsung.com>
Fri, 18 Aug 2017 08:03:59 +0000 (17:03 +0900)
committerHyunho Kang <hhstark.kang@samsung.com>
Fri, 18 Aug 2017 08:25:06 +0000 (17:25 +0900)
Change-Id: Ieed12026b3f280b174d58101261c242e037a36fa
Signed-off-by: Hyunho Kang <hhstark.kang@samsung.com>
widget_viewer_evas/src/widget_viewer_evas.c

index 3638ba486939cc983e648ae9b8ca48366d8f7c90..4a845199a93f69af136925701de72c5177ac33c9 100644 (file)
@@ -181,6 +181,7 @@ struct widget_info {
        bool is_created;
        GQueue *pending_queue;
        bool is_faulted;
+       screen_connector_toolkit_evas_h toolkit_h;
 };
 
 static void __flush_event_queue(struct widget_info *info);
@@ -522,6 +523,7 @@ static int __restart_terminated_widget(const char *widget_id)
        struct widget_info *widget_instance_info;
        int w, h;
        int target_pid = 0;
+       screen_connector_toolkit_evas_h toolkit_h;
 
        g_hash_table_iter_init(&iter, s_info.widget_table);
        while (g_hash_table_iter_next(&iter, &key, &value)) {
@@ -550,8 +552,10 @@ static int __restart_terminated_widget(const char *widget_id)
                        ops.removed_cb = __screen_connector_toolkit_evas_removed_cb;
                        ops.updated_cb = __screen_connector_toolkit_evas_updated_cb;
 
-                       screen_connector_toolkit_evas_add(&ops, widget_instance_info->instance_id,
+                       toolkit_h = screen_connector_toolkit_evas_add(&ops, widget_instance_info->instance_id,
                                SCREEN_CONNECTOR_SCREEEN_TYPE_WIDGET, widget_instance_info);
+                       if (toolkit_h != NULL)
+                               widget_instance_info->toolkit_h = toolkit_h;
                        widget_instance_info->pid = widget_instance_launch(widget_instance_info->instance_id, widget_instance_info->content_info, w, h);
                        widget_instance_info->restart = false;
                }
@@ -949,6 +953,7 @@ static void resize_cb(void *data, Evas *e, Evas_Object *layout, void *event_info
        widget_size_type_e size_type;
        screen_connector_toolkit_evas_ops ops;
        struct pending_item *item;
+       screen_connector_toolkit_evas_h toolkit_h;
 
        evas_object_geometry_get(layout, &x, &y, &w, &h);
        if (info->pid == 0) {
@@ -978,7 +983,9 @@ static void resize_cb(void *data, Evas *e, Evas_Object *layout, void *event_info
                ops.added_cb = __screen_connector_toolkit_evas_added_cb;
                ops.removed_cb = __screen_connector_toolkit_evas_removed_cb;
                ops.updated_cb = __screen_connector_toolkit_evas_updated_cb;
-               screen_connector_toolkit_evas_add(&ops, info->instance_id, SCREEN_CONNECTOR_SCREEEN_TYPE_WIDGET, info);
+               toolkit_h = screen_connector_toolkit_evas_add(&ops, info->instance_id, SCREEN_CONNECTOR_SCREEEN_TYPE_WIDGET, info);
+               if (toolkit_h != NULL)
+                       info->toolkit_h = toolkit_h;
 
                info->pid = widget_instance_launch(info->instance_id, info->content_info, w, h);
                if (info->pid < 0) {
@@ -1046,6 +1053,9 @@ static void __destroy_widget_info(gpointer data)
 
        if (info->content_info)
                free(info->content_info);
+
+       screen_connector_toolkit_evas_remove(info->toolkit_h);
+
        free(info);
 }
 
@@ -1637,6 +1647,7 @@ EAPI void widget_viewer_evas_activate_faulted_widget(Evas_Object *widget)
 {
        struct widget_info *info;
        screen_connector_toolkit_evas_ops ops;
+       screen_connector_toolkit_evas_h toolkit_h;
 
        if (!is_widget_feature_enabled()) {
                set_last_result(WIDGET_ERROR_NOT_SUPPORTED);
@@ -1681,7 +1692,9 @@ EAPI void widget_viewer_evas_activate_faulted_widget(Evas_Object *widget)
                ops.added_cb = __screen_connector_toolkit_evas_added_cb;
                ops.removed_cb = __screen_connector_toolkit_evas_removed_cb;
                ops.updated_cb = __screen_connector_toolkit_evas_updated_cb;
-               screen_connector_toolkit_evas_add(&ops, info->instance_id, SCREEN_CONNECTOR_SCREEEN_TYPE_WIDGET, info);
+               toolkit_h = screen_connector_toolkit_evas_add(&ops, info->instance_id, SCREEN_CONNECTOR_SCREEEN_TYPE_WIDGET, info);
+               if (toolkit_h)
+                       info->toolkit_h = toolkit_h;
                info->is_faulted = false;
                info->pid = widget_instance_launch(info->instance_id, info->content_info, w, h);
                if (info->pid < 0) {