aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-04-26 17:19:37 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-04-30 20:45:45 +0200
commitc52dcdac915b9821c5744c34fe501176d8df3bc1 (patch)
tree7d45558c56d74ee31bac0ab8b804e9dc5db40885
parentefl_ui_pager: refactor registering function for pager (diff)
downloadefl-c52dcdac915b9821c5744c34fe501176d8df3bc1.tar.gz
efl_ui_pager: ensure objects are added and deduplicated
everything else will make things fall apart Reviewed-by: Cedric BAIL <cedric.bail@free.fr> Differential Revision: https://phab.enlightenment.org/D8741
-rw-r--r--src/lib/elementary/efl_ui_pager.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/elementary/efl_ui_pager.c b/src/lib/elementary/efl_ui_pager.c
index e5856a88ba..b97737ab51 100644
--- a/src/lib/elementary/efl_ui_pager.c
+++ b/src/lib/elementary/efl_ui_pager.c
@@ -401,6 +401,14 @@ _efl_ui_pager_efl_container_content_count(Eo *obj EINA_UNUSED,
static Eina_Bool
_register_child(Eo *obj EINA_UNUSED, Efl_Ui_Pager_Data *pd, Efl_Gfx_Entity *subobj)
{
+ if (eina_list_data_find(pd->content_list, subobj))
+ {
+ ERR("Object already added!");
+ return EINA_FALSE;
+ }
+ if (!efl_ui_widget_sub_object_add(obj, subobj))
+ return EINA_FALSE;
+
if (!pd->transition)
efl_canvas_object_clipper_set(subobj, pd->backclip);