From 5d07e157815c7d70b43345c9bb62211ec617417b Mon Sep 17 00:00:00 2001 From: Yakov Goldberg Date: Sun, 5 Oct 2014 17:33:06 +0300 Subject: fix generation for the case when, widget was deleted --- src/lib/gui_widget.c | 5 ++++- src/lib/json_generator.c | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/gui_widget.c b/src/lib/gui_widget.c index dcb171c..6306ef6 100644 --- a/src/lib/gui_widget.c +++ b/src/lib/gui_widget.c @@ -1394,8 +1394,11 @@ wdg_main_wdg_get(const Gui_Widget *wdg) { EINA_SAFETY_ON_NULL_RETURN_VAL(wdg, NULL); do { + if (!wdg->parent_id) + return wdg; const Gui_Widget *parent = wdg_parent_get(wdg); - if (!parent) return wdg; + if (!parent) + return NULL; else wdg = parent; } while (EINA_TRUE); return NULL; diff --git a/src/lib/json_generator.c b/src/lib/json_generator.c index a434163..9fe4a8b 100644 --- a/src/lib/json_generator.c +++ b/src/lib/json_generator.c @@ -465,6 +465,7 @@ _widgets_json_generate(const Gui_Context *ctx) Gui_Widget *wdg = wdg_get(wdg_id); if (wdg) { + if (!wdg_main_wdg_get(wdg)) continue; if (!obj) obj = eina_json_object_new(); Eina_Json_Value *subobj = _widget_json_generate(wdg); eina_json_object_append(obj, wdg_name_get(wdg), subobj); -- cgit v1.2.1