From be37c47fff3a7baba486c927a5224bec528c1a96 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 10 Jul 2019 14:24:55 -0400 Subject: [PATCH] edje: fix some small leaks when failing to reapply user-defined data Summary: this only occurs when the same text parts don't exist in the new layout, which is an extremely unlikely scenario Depends on D9210 Reviewers: cedric, bu5hm4n Reviewed By: cedric, bu5hm4n Subscribers: bu5hm4n, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9211 --- src/lib/edje/edje_load.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/lib/edje/edje_load.c b/src/lib/edje/edje_load.c index 5170411700..40109c0c1b 100644 --- a/src/lib/edje/edje_load.c +++ b/src/lib/edje/edje_load.c @@ -1621,11 +1621,23 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch child = eud->u.table.child; break; case EDJE_USER_STRING: + eina_stringshare_del(eud->u.string.text); + /* string has extra ref in this case */ + if (!had_file) + eina_stringshare_del(eud->u.string.text); + break; case EDJE_USER_DRAG_STEP: case EDJE_USER_DRAG_PAGE: case EDJE_USER_DRAG_VALUE: case EDJE_USER_DRAG_SIZE: + break; case EDJE_USER_TEXT_STYLE: + { + Edje_Part_Text_Prop *prop; + EINA_LIST_FREE(eud->u.text_style.props, prop) + free(prop); + } + break; case EDJE_USER_TEXT_EXPAND: default: break;