zmike pushed a commit to branch efl-1.22.

http://git.enlightenment.org/core/efl.git/commit/?id=21605898dfb0a8dd3846e8bbf378b9a8a93ccde8

commit 21605898dfb0a8dd3846e8bbf378b9a8a93ccde8
Author: Marcel Hollerbach <[email protected]>
Date:   Wed Apr 17 18:51:32 2019 +0200

    efl_ui_layout: only delete and unparent objects here when alive
    
    something else might cause the object to get magically revived. Once the
    object is invalidated, some things are able to set a parent again, which
    causes the widget to continue with refcount 1 and a parent.
    
    Reviewed-by: Cedric BAIL <[email protected]>
    Differential Revision: https://phab.enlightenment.org/D8637
---
 src/lib/elementary/efl_ui_layout.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/lib/elementary/efl_ui_layout.c 
b/src/lib/elementary/efl_ui_layout.c
index 63f9491467..fa47bc1d1f 100644
--- a/src/lib/elementary/efl_ui_layout.c
+++ b/src/lib/elementary/efl_ui_layout.c
@@ -1010,8 +1010,11 @@ _efl_ui_layout_content_set(Eo *obj, Efl_Ui_Layout_Data 
*sd, const char *part, Ev
              if (!strcmp(part, sub_d->part))
                {
                   if (content == sub_d->obj) goto end;
-                  _eo_unparent_helper(sub_d->obj, obj);
-                  evas_object_del(sub_d->obj);
+                  if (efl_alive_get(sub_d->obj))
+                    {
+                       _eo_unparent_helper(sub_d->obj, obj);
+                       evas_object_del(sub_d->obj);
+                    }
                   break;
                }
              /* was previously swallowed at another part -- mimic

-- 


Reply via email to