eo: only call efl_parent_set when parent_id is available
authorMarcel Hollerbach <mail@marcel-hollerbach.de>
Tue, 19 Jun 2018 17:35:38 +0000 (13:35 -0400)
committerJongmin Lee <jm105.lee@samsung.com>
Tue, 19 Jun 2018 21:44:59 +0000 (06:44 +0900)
Summary:
this is no functinal change, we safe the calling to efl_parent_set.
Nothing else, the base implementation is initializated with NULL as
parent, and efl_parent_set with NULL would have returned in the first
few lines.

fix T7032

Reviewers: devilhorns, zmike

Reviewed By: zmike

Subscribers: cedric, #committers, zmike

Tags: #efl

Maniphest Tasks: T7032

Differential Revision: https://phab.enlightenment.org/D6327

src/lib/eo/eo.c

index 2df52d3..6dbd66b 100644 (file)
@@ -911,7 +911,7 @@ _efl_add_internal_start(const char *file, int line, const Efl_Class *klass_id, E
    efl_ref(eo_id);
 
    /* Reference for the parent if is_ref is done in _efl_add_end */
-   efl_parent_set(eo_id, parent_id);
+   if (parent_id) efl_parent_set(eo_id, parent_id);
 
    /* eo_id can change here. Freeing is done on the resolved object. */
    eo_id = efl_constructor(eo_id);