evas/font: fix a memory leak caused by legacy code with wrong migration 60/245260/1
authorYoungbok Shin <youngb.shin@samsung.com>
Tue, 6 Oct 2020 06:28:33 +0000 (15:28 +0900)
committerYoungbok Shin <youngb.shin@samsung.com>
Tue, 6 Oct 2020 06:28:33 +0000 (15:28 +0900)
@tizen_fix

Change-Id: I51d570ddc8e3a545547c00b73ffb86f1ef1f7451

src/lib/evas/common/evas_font_main.c

index 4583ecc..bafb7fb 100644 (file)
@@ -899,24 +899,6 @@ evas_common_font_int_cache_glyph_get(RGBA_Font_Int *fi, FT_UInt idx)
     * END *
     *******/
 
-   FTLOCK();
-   error = FT_Get_Glyph(fi->src->ft.face->glyph, &(fg->glyph));
-   FTUNLOCK();
-   if (error)
-     {
-        /******************************************************************
-         * TIZEN_ONLY(20180402): evas font: add/apply font glyph lru list *
-         ******************************************************************/
-        ERR("Failed to get a glyph using FT_Get_Glyph for idx[%d]. fg_from_fash[%d]", idx, fg_from_fash);
-        /*******
-         * END *
-         *******/
-        free(fg);
-        if (!fi->fash) fi->fash = _fash_gl_new();
-        if (fi->fash) _fash_gl_add(fi->fash, idx, (void *)(-1));
-        return NULL;
-     }
-
    if (FT_HAS_COLOR(fi->src->ft.face))
      {
         fg->advance.x = fi->src->ft.face->glyph->advance.x * 1024;
@@ -927,27 +909,10 @@ evas_common_font_int_cache_glyph_get(RGBA_Font_Int *fi, FT_UInt idx)
         fg->x_bear = EVAS_FONT_ROUND_26_6_TO_INT(slot->metrics.horiBearingX);
         fg->y_bear = EVAS_FONT_ROUND_26_6_TO_INT(slot->metrics.horiBearingY);
 
-        /******************************************************************
-         * TIZEN_ONLY(20180402): evas font: add/apply font glyph lru list *
-         ******************************************************************/
-        fg->advance = fg->glyph->advance;
-        /*******
-         * END *
-         *******/
-
         if (FT_HAS_FIXED_SIZES(fi->src->ft.face))
           {
              if (fi->bitmap_scalable & EFL_TEXT_FONT_BITMAP_SCALABLE_COLOR)
                {
-                  /******************************************************************
-                   * TIZEN_ONLY(20180402): evas font: add/apply font glyph lru list *
-                   ******************************************************************
-                   */
-                  fg->glyph->advance.x *= fi->scale_factor;
-                  fg->glyph->advance.y *= fi->scale_factor;
-                  /*******
-                   * END *
-                   *******/
                   fg->advance.x *= fi->scale_factor;
                   fg->advance.y *= fi->scale_factor;
                   fg->width *= fi->scale_factor;