From: Woochanlee Date: Thu, 24 Dec 2020 02:47:03 +0000 (+0900) Subject: eo_base_class: Avoid useless memory alloc X-Git-Tag: accepted/tizen/unified/20211001.001525~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F90%2F264590%2F1;p=platform%2Fupstream%2Fefl.git eo_base_class: Avoid useless memory alloc Summary: The pd->ext will be NULL when the target object on invalidate state or edje object or isolated object etc.. In above case, If data is NULL and ext is not needed, it seems there is no need to create a node. Reviewers: raster, cedric, Hermet Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D12206 Change-Id: I7000fd4cbf48c0841865483092e5b778602886d1 --- diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c index e744502..52c5ca9 100644 --- a/src/lib/eo/eo_base_class.c +++ b/src/lib/eo/eo_base_class.c @@ -362,6 +362,8 @@ _key_generic_set(const Eo *obj, Efl_Object_Data *pd, const char *key, const void } } } + else + if (!data) return NULL; ext = _efl_object_extension_need(pd); if (ext)