summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-12-09 21:02:26 +0100
committerCedric BAIL <cedric.bail@free.fr>2019-12-13 09:33:03 -0800
commit349df856791abf9adb2e3f66c90e476947e3431b (patch)
tree593fb46214af8a707750db7ac15d23bd411426f0
parent431800a529fba3ff90c77cfdb3cd76e79c59528a (diff)
efl_ui_spotlight_manager_*: do not keep ptr of dead pointer
when content is deleted, we should not keep a dangling pointer of it. Setting it to NULL here is enough, as later on a swtich_to reuest will be sent. Reviewed-by: Cedric BAIL <cedric.bail@free.fr> Differential Revision: https://phab.enlightenment.org/D10844
-rw-r--r--src/lib/elementary/efl_ui_spotlight_manager_plain.c2
-rw-r--r--src/lib/elementary/efl_ui_spotlight_manager_stack.c5
2 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/elementary/efl_ui_spotlight_manager_plain.c b/src/lib/elementary/efl_ui_spotlight_manager_plain.c
index 83aab8fcce..d9c52ab3db 100644
--- a/src/lib/elementary/efl_ui_spotlight_manager_plain.c
+++ b/src/lib/elementary/efl_ui_spotlight_manager_plain.c
@@ -90,6 +90,8 @@ EOLIAN static void
90_efl_ui_spotlight_manager_plain_efl_ui_spotlight_manager_content_del(Eo *obj, Efl_Ui_Spotlight_Manager_Plain_Data *pd, Efl_Gfx_Entity *subobj, int index EINA_UNUSED) 90_efl_ui_spotlight_manager_plain_efl_ui_spotlight_manager_content_del(Eo *obj, Efl_Ui_Spotlight_Manager_Plain_Data *pd, Efl_Gfx_Entity *subobj, int index EINA_UNUSED)
91{ 91{
92 efl_canvas_group_member_remove(pd->container, subobj); 92 efl_canvas_group_member_remove(pd->container, subobj);
93 if (pd->current_content == subobj)
94 pd->current_content = NULL;
93 _content_changed(obj, pd); 95 _content_changed(obj, pd);
94} 96}
95EOLIAN static void 97EOLIAN static void
diff --git a/src/lib/elementary/efl_ui_spotlight_manager_stack.c b/src/lib/elementary/efl_ui_spotlight_manager_stack.c
index b286d75eab..d7d6d94c62 100644
--- a/src/lib/elementary/efl_ui_spotlight_manager_stack.c
+++ b/src/lib/elementary/efl_ui_spotlight_manager_stack.c
@@ -105,6 +105,11 @@ EOLIAN static void
105_efl_ui_spotlight_manager_stack_efl_ui_spotlight_manager_content_del(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Stack_Data *pd, Efl_Gfx_Entity *subobj, int index) 105_efl_ui_spotlight_manager_stack_efl_ui_spotlight_manager_content_del(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Stack_Data *pd, Efl_Gfx_Entity *subobj, int index)
106{ 106{
107 efl_canvas_group_member_remove(pd->container, subobj); 107 efl_canvas_group_member_remove(pd->container, subobj);
108 for (int i = 0; i < 2; ++i)
109 {
110 if (pd->content[i] == subobj)
111 pd->content[i] = NULL;
112 }
108 _update_ids(obj, pd, index); 113 _update_ids(obj, pd, index);
109} 114}
110 115