From f47c68ce9edf524040357a2992fab097ee40c7d9 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 8 Aug 2018 15:56:02 +0900 Subject: [PATCH] efl_ui/image_zoomable: fix internal eina file refcounting Summary: this pointer is owned by elm_theme, not the image, so the image refcount must be increased in order to avoid accidentally closing the file which is still in use by elm_theme and triggering a crash this resolves the crash in the `efl_ui_image_zoomable_icon` test Reviewers: Hermet Reviewed By: Hermet Subscribers: #reviewers, cedric, #committers Tags: #efl_widgets Differential Revision: https://phab.enlightenment.org/D6774 --- src/lib/elementary/efl_ui_image_zoomable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/elementary/efl_ui_image_zoomable.c b/src/lib/elementary/efl_ui_image_zoomable.c index 4a31c41c0e..7526260747 100644 --- a/src/lib/elementary/efl_ui_image_zoomable.c +++ b/src/lib/elementary/efl_ui_image_zoomable.c @@ -2831,7 +2831,7 @@ _image_zoomable_object_icon_set(Evas_Object *o, const char *group, char *style, { if (sd->f) eina_file_close(sd->f); eina_stringshare_replace(&sd->file, eina_file_filename_get(f)); - sd->f = f; + sd->f = eina_file_dup(f); return _img_proxy_set(o, sd, NULL, f, buf, resize); }