mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-27 11:57:48 +08:00
fix(freetype): check if ctx is null before deleting font (#9728)
This commit is contained in:
@@ -242,6 +242,10 @@ void lv_freetype_font_delete(lv_font_t * font)
|
|||||||
{
|
{
|
||||||
LV_ASSERT_NULL(font);
|
LV_ASSERT_NULL(font);
|
||||||
lv_freetype_context_t * ctx = lv_freetype_get_context();
|
lv_freetype_context_t * ctx = lv_freetype_get_context();
|
||||||
|
if(!ctx) {
|
||||||
|
/* Freetype already torn down (e.g. static destruction order). Nothing to release. */
|
||||||
|
return;
|
||||||
|
}
|
||||||
lv_freetype_font_dsc_t * dsc = (lv_freetype_font_dsc_t *)(font->dsc);
|
lv_freetype_font_dsc_t * dsc = (lv_freetype_font_dsc_t *)(font->dsc);
|
||||||
LV_ASSERT_FREETYPE_FONT_DSC(dsc);
|
LV_ASSERT_FREETYPE_FONT_DSC(dsc);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user