Free font data also from _ft_new_face_uncached
Function CairoFreeTypeFont::create
expects that _ft_new_face
will own and free font_data
only in case when it returns true and must not free it when it fails and returns false. There was double free when cairo_font_face_set_user_data
in _ft_new_face
failed. If CAN_CHECK_OPEN_FACES
is not defined (non-unix systems?) then is called _ft_new_face_uncached
instead of _ft_new_face
also for "memory" fonts (for example fonts embedded in pdf) but there was missing deallocation of font_data
in _ft_done_face_uncached
. Documentation about FT_New_Memory_Face
says that font data must not be deallocated before FT_Done_Face
: "You must not deallocate the memory before calling FT_Done_Face".