forked from enlightenment/efl
cserve2: fix minor memleaks with fonts
Leaks happen when fonts fail to load
This commit is contained in:
parent
9929ee9aec
commit
d2c3b67a72
|
@ -355,7 +355,13 @@ evas_common_font_int_memory_load(const char *source, const char *name, int size,
|
||||||
fi->cs2_handler = evas_cserve2_font_load(source, name, size, font_dpi,
|
fi->cs2_handler = evas_cserve2_font_load(source, name, size, font_dpi,
|
||||||
wanted_rend);
|
wanted_rend);
|
||||||
if (fi->cs2_handler)
|
if (fi->cs2_handler)
|
||||||
evas_cserve2_font_load_wait((Font_Entry *)fi->cs2_handler);
|
{
|
||||||
|
if (evas_cserve2_font_load_wait((Font_Entry *)fi->cs2_handler) != 0)
|
||||||
|
{
|
||||||
|
evas_cserve2_font_free(fi->cs2_handler);
|
||||||
|
fi->cs2_handler = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
free(fake_name);
|
free(fake_name);
|
||||||
|
@ -391,7 +397,13 @@ evas_common_font_int_load(const char *name, int size,
|
||||||
fi->cs2_handler = evas_cserve2_font_load(NULL, name, size, font_dpi,
|
fi->cs2_handler = evas_cserve2_font_load(NULL, name, size, font_dpi,
|
||||||
wanted_rend);
|
wanted_rend);
|
||||||
if (fi->cs2_handler)
|
if (fi->cs2_handler)
|
||||||
evas_cserve2_font_load_wait((Font_Entry *)fi->cs2_handler);
|
{
|
||||||
|
if (evas_cserve2_font_load_wait((Font_Entry *)fi->cs2_handler) != 0)
|
||||||
|
{
|
||||||
|
evas_cserve2_font_free(fi->cs2_handler);
|
||||||
|
fi->cs2_handler = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
// evas_common_font_int_load_complete(fi);
|
// evas_common_font_int_load_complete(fi);
|
||||||
|
|
|
@ -1165,6 +1165,7 @@ evas_cserve2_font_free(Font_Entry *fe)
|
||||||
if (ret != CSERVE2_NONE)
|
if (ret != CSERVE2_NONE)
|
||||||
{
|
{
|
||||||
ERR("Failed to wait loading font '%s'.", fe->name);
|
ERR("Failed to wait loading font '%s'.", fe->name);
|
||||||
|
_font_entry_free(fe);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue