ESP32_TFT_library icon indicating copy to clipboard operation
ESP32_TFT_library copied to clipboard

load_file_font

Open nottledim opened this issue 6 years ago • 3 comments

First time I've seen a "goto" in code for a long time. Guess what - there a bug!

in component/tft/tft.c

If, for some reason the file size check (or one of the other tests) fails after the file is opened it's essential that the file closed otherwise spiffs quickly runs out of file handles.

adding a close(fhndl) after the exit label helps.

nottledim avatar Nov 10 '17 19:11 nottledim

Thank you for reporting this. The file should be opened after the size check. It is closed imediately after reading, so there is no need to close it after exit label.

loboris avatar Nov 11 '17 00:11 loboris

That's a better solution, thanks

nottledim avatar Nov 11 '17 09:11 nottledim

Whilst you're fixing that would you consider making error numbers reported by compile_font_file and load_file_font unique. Also perhaps print err as well err_msg in penultimate line of compile_font_file. Thanks.

nottledim avatar Nov 11 '17 09:11 nottledim