From: Shinwoo Kim Date: Sat, 13 Feb 2021 11:51:16 +0000 (+0000) Subject: gl: remove memory leak of orient_set X-Git-Tag: accepted/tizen/unified/20210218.042126~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bf53f68036f973b7d71bff266fb1bf4ef641f8ee;p=platform%2Fupstream%2Fefl.git gl: remove memory leak of orient_set Summary: The tex->pt->references is descreased by evas_gl_common_texture_free -> pt_unref if tex->references is 0 And tex->pt->texture is removed by evas_gl_common_texture_free -> pt_unref -> glDeleteTextures if tex->pt->references is 0 The evas_gl_common_texture_free decreases tex->references only if tex->references is bigger than 0. There is no chance to decrease tex->pt->references at this point. So if orient_set increases both references of tex and tex->pt, then the tex->pt->reference is not decreased till tex->references is 0. So do not increase tex->pt->references in eng_orient_set. Reviewers: raster, cedric, Hermet Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D12243 Change-Id: I193f4007e53e1f6077e9baf55aa774504353c7df --- diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c b/src/modules/evas/engines/gl_generic/evas_engine.c index 9ca7d0e..db72b4e 100755 --- a/src/modules/evas/engines/gl_generic/evas_engine.c +++ b/src/modules/evas/engines/gl_generic/evas_engine.c @@ -1372,7 +1372,6 @@ eng_image_orient_set(void *engine, void *image, Evas_Image_Orient orient) { im_new->tex = im->tex; im_new->tex->references++; - im_new->tex->pt->references++; } evas_gl_common_image_free(im);