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
This commit is contained in:
Marcel Hollerbach 2019-12-09 21:02:26 +01:00 committed by Cedric BAIL
parent 431800a529
commit 349df85679
2 changed files with 7 additions and 0 deletions

View File

@ -90,6 +90,8 @@ EOLIAN static void
_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)
{
efl_canvas_group_member_remove(pd->container, subobj);
if (pd->current_content == subobj)
pd->current_content = NULL;
_content_changed(obj, pd);
}
EOLIAN static void

View File

@ -105,6 +105,11 @@ EOLIAN static void
_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)
{
efl_canvas_group_member_remove(pd->container, subobj);
for (int i = 0; i < 2; ++i)
{
if (pd->content[i] == subobj)
pd->content[i] = NULL;
}
_update_ids(obj, pd, index);
}