summaryrefslogtreecommitdiff
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
parenta20cacf53f4c85d10048c86c96ae92db0de6fff1 (diff)
efl_ui_focus_manager_sub: avoid a call to NULL
Summary: we need to consider the manager change to NULL @ref T6616 Reviewers: bu5hm4n Subscribers: cedric Maniphest Tasks: 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)
32static void 32static void
33_register(Efl_Ui_Focus_Manager *obj, Efl_Ui_Focus_Manager *par_m, Efl_Ui_Focus_Object *node, Efl_Ui_Focus_Object *logical) 33_register(Efl_Ui_Focus_Manager *obj, Efl_Ui_Focus_Manager *par_m, Efl_Ui_Focus_Object *node, Efl_Ui_Focus_Object *logical)
34{ 34{
35 efl_ui_focus_manager_calc_register(par_m, node, logical, obj); 35 if (par_m)
36 efl_ui_focus_manager_calc_register(par_m, node, logical, obj);
36} 37}
37 38
38static void 39static void
39_unregister(Efl_Ui_Focus_Manager *obj EINA_UNUSED, Efl_Ui_Focus_Manager *par_m, Efl_Ui_Focus_Object *node) 40_unregister(Efl_Ui_Focus_Manager *obj EINA_UNUSED, Efl_Ui_Focus_Manager *par_m, Efl_Ui_Focus_Object *node)
40{ 41{
41 efl_ui_focus_manager_calc_unregister(par_m, node); 42 if (par_m)
43 efl_ui_focus_manager_calc_unregister(par_m, node);
42} 44}
43 45
44static void 46static void
@@ -159,6 +161,9 @@ _flush_manager(Eo *obj, Efl_Ui_Focus_Manager_Sub_Data *pd)
159 logical = efl_ui_focus_object_focus_parent_get(obj); 161 logical = efl_ui_focus_object_focus_parent_get(obj);
160 manager = efl_ui_focus_object_focus_manager_get(obj); 162 manager = efl_ui_focus_object_focus_manager_get(obj);
161 163
164 if (pd->manager == manager)
165 return;
166
162 //unregister from the old 167 //unregister from the old
163 if (pd->manager) efl_event_callback_array_del(pd->manager, parent_manager(), obj); 168 if (pd->manager) efl_event_callback_array_del(pd->manager, parent_manager(), obj);
164 if (manager) efl_event_callback_array_add(manager, parent_manager(), obj); 169 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)
167 { 172 {
168 if (b == obj) continue; 173 if (b == obj) continue;
169 174
170 _unregister(obj, manager, b); 175 _unregister(obj, pd->manager, b);
171 _register(obj, manager, b, logical); 176 _register(obj, manager, b, logical);
172 } 177 }
173 //unregister the old manager, use the new 178 //unregister the old manager, use the new