aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYeongJong Lee <yj34.lee@samsung.com>2018-01-31 14:29:18 +0100
committerMarcel Hollerbach <marcel@osg.samsung.com>2018-01-31 14:29:18 +0100
commitf00000df5a2483eb669b52c6c30587c1b0a9078b (patch)
treeec4afac0c93344746784a399d1278897bb37eed0
parentelm_menu: avoid a call to NULL (diff)
downloadefl-f00000df5a2483eb669b52c6c30587c1b0a9078b.tar.gz
efl_ui_focus_manager_sub: avoid a call to NULL
Summary: we need to consider the manager change to NULL @ref https://phab.enlightenment.org/T6616 Reviewers: bu5hm4n Subscribers: cedric Maniphest Tasks: https://phab.enlightenment.org/T6616 Differential Revision: https://phab.enlightenment.org/D5771
-rw-r--r--src/lib/elementary/efl_ui_focus_manager_sub.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/lib/elementary/efl_ui_focus_manager_sub.c b/src/lib/elementary/efl_ui_focus_manager_sub.c
index d6f45ad5c5..739772f0ad 100644
--- a/src/lib/elementary/efl_ui_focus_manager_sub.c
+++ b/src/lib/elementary/efl_ui_focus_manager_sub.c
@@ -32,13 +32,15 @@ _set_a_without_b(Eina_List *a, Eina_List *b)
static void
_register(Efl_Ui_Focus_Manager *obj, Efl_Ui_Focus_Manager *par_m, Efl_Ui_Focus_Object *node, Efl_Ui_Focus_Object *logical)
{
- efl_ui_focus_manager_calc_register(par_m, node, logical, obj);
+ if (par_m)
+ efl_ui_focus_manager_calc_register(par_m, node, logical, obj);
}
static void
_unregister(Efl_Ui_Focus_Manager *obj EINA_UNUSED, Efl_Ui_Focus_Manager *par_m, Efl_Ui_Focus_Object *node)
{
- efl_ui_focus_manager_calc_unregister(par_m, node);
+ if (par_m)
+ efl_ui_focus_manager_calc_unregister(par_m, node);
}
static void
@@ -159,6 +161,9 @@ _flush_manager(Eo *obj, Efl_Ui_Focus_Manager_Sub_Data *pd)
logical = efl_ui_focus_object_focus_parent_get(obj);
manager = efl_ui_focus_object_focus_manager_get(obj);
+ if (pd->manager == manager)
+ return;
+
//unregister from the old
if (pd->manager) efl_event_callback_array_del(pd->manager, parent_manager(), obj);
if (manager) efl_event_callback_array_add(manager, parent_manager(), obj);
@@ -167,7 +172,7 @@ _flush_manager(Eo *obj, Efl_Ui_Focus_Manager_Sub_Data *pd)
{
if (b == obj) continue;
- _unregister(obj, manager, b);
+ _unregister(obj, pd->manager, b);
_register(obj, manager, b, logical);
}
//unregister the old manager, use the new