Hey Tom,

Thanks for the fix.

I still have an issue there. If you reparent a composite member, it will still 
remove the reference of the parent (because of parent_set(NULL) of 
composite_detach) without putting it back when setting the new parent. It then 
leads to the error message "_eo_base_destructor() Object '0x...' still has a 
parent at the time of destruction".

Why don't we re-ref in case the old parent is NULL? Something like:
--- a/src/lib/eo/eo_base_class.c
+++ b/src/lib/eo/eo_base_class.c
@@ -515,6 +515,11 @@ _eo_base_parent_set(Eo *obj, Eo_Base_Data *pd, Eo 
*parent_id)

         if (EINA_LIKELY(parent_pd != NULL))
           {
+             /* Ref only if this object is an orphan
+              * This can happen if the object is part of a composite. Detach 
unparents the object, leading to unref it.
+              * Since we just replace the parent, we have to re-ref the object.
+              */
+             if (!pd->parent) eo_ref(obj);
              pd->parent = parent_id;
              parent_pd->children = eina_list_append(parent_pd->children, obj);
              pd->parent_list = eina_list_last(parent_pd->children);

JackDanielZ

On Thu, 28 Apr 2016 07:54:58 -0700
Tom Hacohen <[email protected]> wrote:

> tasn pushed a commit to branch master.
> 
> http://git.enlightenment.org/core/efl.git/commit/?id=46ac246a3195721bd207300c5db14e7aac593686
> 
> commit 46ac246a3195721bd207300c5db14e7aac593686
> Author: Tom Hacohen <[email protected]>
> Date:   Thu Apr 28 15:54:34 2016 +0100
> 
>     Elm combobox: composite attach objects after reparenting.
>     
>     This fixes the segfault reported by Jack.
>     
>     The problem was that the object was being reparented and thus
>     removed from the composition and never added back.
> ---
>  src/lib/elementary/elc_combobox.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/src/lib/elementary/elc_combobox.c
> b/src/lib/elementary/elc_combobox.c index 792017e..c347b1e 100644
> --- a/src/lib/elementary/elc_combobox.c
> +++ b/src/lib/elementary/elc_combobox.c
> @@ -380,7 +380,6 @@ _elm_combobox_multiple_selection_set(Eo *obj,
> Elm_Combobox_Data *pd, elm_object_part_text_set(pd->mbe, "guide",
> elm_object_part_text_get(pd->entry, "guide"));
>          evas_object_hide(pd->entry);
> -        eo_composite_attach(obj, pd->mbe);
>  
>          scr = elm_scroller_add(obj);
>          elm_scroller_bounce_set(scr, EINA_FALSE, EINA_TRUE);
> @@ -391,6 +390,8 @@ _elm_combobox_multiple_selection_set(Eo *obj,
> Elm_Combobox_Data *pd, elm_object_content_set(scr, pd->mbe);
>          elm_object_part_content_set(obj, "elm.swallow.content", scr);
>          elm_widget_can_focus_set(pd->genlist, EINA_FALSE);
> +
> +        eo_composite_attach(obj, pd->mbe);
>       }
>     else
>       {
> @@ -402,6 +403,8 @@ _elm_combobox_multiple_selection_set(Eo *obj,
> Elm_Combobox_Data *pd, elm_widget_can_focus_set(pd->genlist,
> EINA_TRUE); elm_genlist_item_bring_in(pd->item,
> ELM_GENLIST_ITEM_SCROLLTO_NONE); evas_object_hide(scr);
> +
> +        eo_composite_attach(obj, pd->entry);
>       }
>  }
>  
> @@ -481,10 +484,11 @@ _elm_combobox_eo_base_constructor(Eo *obj,
> Elm_Combobox_Data *sd) eo_event_callback_array_add(entry,
> entry_callbacks(), obj); evas_object_show(entry);
>  
> +   elm_object_part_content_set(obj, "elm.swallow.content", entry);
> +
>     eo_composite_attach(obj, gl);
>     eo_composite_attach(obj, entry);
>  
> -   elm_object_part_content_set(obj, "elm.swallow.content", entry);
>     return obj;
>  }
>  
> 


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to