summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYakov Goldberg <yakov.g@samsung.com>2014-10-05 17:33:06 +0300
committerYakov Goldberg <yakov.g@samsung.com>2014-10-05 17:33:06 +0300
commit5d07e157815c7d70b43345c9bb62211ec617417b (patch)
treecfe3bc5bf6d7dcc9c939a36b72dbce195a4ec08b
parent9a19089de99bbdcfc6659adb0616ea0a04c51fcb (diff)
fix generation for the case when, widget was deleted
-rw-r--r--src/lib/gui_widget.c5
-rw-r--r--src/lib/json_generator.c1
2 files changed, 5 insertions, 1 deletions
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)
1394{ 1394{
1395 EINA_SAFETY_ON_NULL_RETURN_VAL(wdg, NULL); 1395 EINA_SAFETY_ON_NULL_RETURN_VAL(wdg, NULL);
1396 do { 1396 do {
1397 if (!wdg->parent_id)
1398 return wdg;
1397 const Gui_Widget *parent = wdg_parent_get(wdg); 1399 const Gui_Widget *parent = wdg_parent_get(wdg);
1398 if (!parent) return wdg; 1400 if (!parent)
1401 return NULL;
1399 else wdg = parent; 1402 else wdg = parent;
1400 } while (EINA_TRUE); 1403 } while (EINA_TRUE);
1401 return NULL; 1404 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)
465 Gui_Widget *wdg = wdg_get(wdg_id); 465 Gui_Widget *wdg = wdg_get(wdg_id);
466 if (wdg) 466 if (wdg)
467 { 467 {
468 if (!wdg_main_wdg_get(wdg)) continue;
468 if (!obj) obj = eina_json_object_new(); 469 if (!obj) obj = eina_json_object_new();
469 Eina_Json_Value *subobj = _widget_json_generate(wdg); 470 Eina_Json_Value *subobj = _widget_json_generate(wdg);
470 eina_json_object_append(obj, wdg_name_get(wdg), subobj); 471 eina_json_object_append(obj, wdg_name_get(wdg), subobj);