summaryrefslogtreecommitdiff
path: root/src/modules/evas/engines/buffer/evas_outbuf.c
diff options
context:
space:
mode:
authorWoochanlee <wc0917.lee@samsung.com>2020-09-17 17:23:41 +0900
committerHermet Park <chuneon.park@samsung.com>2020-09-17 17:23:42 +0900
commit875f05cef53a973eee7fe25abdbcb824896f9d0e (patch)
treed891cbcbdcc20df3e00041cf8d37af5daedd6926 /src/modules/evas/engines/buffer/evas_outbuf.c
parentca2900be8a109e3e205a8c49ff11a1f822ae96b7 (diff)
evas_outbuf: Fix memory leak.
Summary: In certain use cases, when image data is created twice, the existing memory pointer is isolated and a memory leak occurs. Reviewers: raster, Hermet Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8813 Differential Revision: https://phab.enlightenment.org/D12148
Diffstat (limited to '')
-rw-r--r--src/modules/evas/engines/buffer/evas_outbuf.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/modules/evas/engines/buffer/evas_outbuf.c b/src/modules/evas/engines/buffer/evas_outbuf.c
index 545ff096ed..d143179f21 100644
--- a/src/modules/evas/engines/buffer/evas_outbuf.c
+++ b/src/modules/evas/engines/buffer/evas_outbuf.c
@@ -45,8 +45,9 @@ evas_buffer_outbuf_buf_update_fb(Outbuf *buf, int w, int h, Outbuf_Depth depth,
45 if ((buf->depth == OUTBUF_DEPTH_ARGB_32BPP_8888_8888) && 45 if ((buf->depth == OUTBUF_DEPTH_ARGB_32BPP_8888_8888) &&
46 (buf->dest) && (buf->dest_row_bytes == (buf->w * sizeof(DATA32)))) 46 (buf->dest) && (buf->dest_row_bytes == (buf->w * sizeof(DATA32))))
47 { 47 {
48 memset(buf->dest, 0, h * buf->dest_row_bytes); 48 memset(buf->dest, 0, h * buf->dest_row_bytes);
49 buf->priv.back_buf = 49 if (buf->priv.back_buf) evas_cache_image_drop(&buf->priv.back_buf->cache_entry);
50 buf->priv.back_buf =
50 (RGBA_Image *) evas_cache_image_data(evas_common_image_cache_get(), 51 (RGBA_Image *) evas_cache_image_data(evas_common_image_cache_get(),
51 w, h, buf->dest, 52 w, h, buf->dest,
52 1, EVAS_COLORSPACE_ARGB8888); 53 1, EVAS_COLORSPACE_ARGB8888);
@@ -54,6 +55,7 @@ evas_buffer_outbuf_buf_update_fb(Outbuf *buf, int w, int h, Outbuf_Depth depth,
54 else if ((buf->depth == OUTBUF_DEPTH_RGB_32BPP_888_8888) && 55 else if ((buf->depth == OUTBUF_DEPTH_RGB_32BPP_888_8888) &&
55 (buf->dest) && (buf->dest_row_bytes == (buf->w * sizeof(DATA32)))) 56 (buf->dest) && (buf->dest_row_bytes == (buf->w * sizeof(DATA32))))
56 { 57 {
58 if (buf->priv.back_buf) evas_cache_image_drop(&buf->priv.back_buf->cache_entry);
57 buf->priv.back_buf = 59 buf->priv.back_buf =
58 (RGBA_Image *) evas_cache_image_data(evas_common_image_cache_get(), 60 (RGBA_Image *) evas_cache_image_data(evas_common_image_cache_get(),
59 w, h, buf->dest, 61 w, h, buf->dest,