eo - base class protection against NULL old_parent_pd
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Tue, 26 Nov 2013 08:01:26 +0000 (17:01 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Tue, 26 Nov 2013 08:03:50 +0000 (17:03 +0900)
bug T569 still shows that we have cases where, during e shutdown, we
still get eo_data_scope_get() return NULL for a parent object.
whatever this is, segfaulting is much worse than protecting and
marching on. so protect

src/lib/eo/eo_base_class.c

index 772683c..8d137e1 100644 (file)
@@ -131,8 +131,9 @@ _parent_set(Eo *obj, void *class_data, va_list *list)
         Private_Data *old_parent_pd;
 
         old_parent_pd = eo_data_scope_get(pd->parent, EO_BASE_CLASS);
-        old_parent_pd->children = eina_list_remove(old_parent_pd->children,
-                                                   obj);
+        if (old_parent_pd)
+          old_parent_pd->children = eina_list_remove(old_parent_pd->children,
+                                                     obj);
         eo_xunref(obj, pd->parent);
      }