Closed milen-prg closed 1 year ago
Thanks for the report. I'll take a look
This is my font, you can try directly with it, but I thing it is not the problem. JuliaMono-Bold18.zip
tigrFreeFont releases the bitmap, tigrFree(fontImage); should not be needed ?
@JettMonstersGoBoom, indeed, if I comment the tigrFree(fontImage);, but keep the tigrFreeFont(font);, the program do not crashes and there is no memory leaks. But this is not intuitive, I would never guess, where and when must free the bitmaps?
I'd expect tigrFreeFont to free all memory used by the font. all other bitmaps just use tigrFree.
Thanks, @JettMonstersGoBoom. Yes, the font created by tigrLoadFont
takes ownership of the provided font sheet bitmap. I'll add a note about that in the api docs.
Windows 10 Pro 64 bit, both MINGW64 and MSVC 2022 are tried, all updated to the last version.
I apologize, but try to use the new tigrfont-v1.0.1 (Windows exe, precompiled) to generate custom font. This is the minimal code:
`
include "tigr.h"
int main(int argc, char argv[]){ Tigr screen = tigrWindow(320, 240, "Proba1", 0);
} `
It WORKS fine, all, the Cyrillic symbols are displayed properly, until the the window is closed and exactly at the row:
the program CRASHES. If I comment this row, the program closes normally, but I check - then there is memory leakage as expected.
Please for advice, may be I do something wrong? I try to change the three "free" rows order, but this did not change anything, the program always crashes exactly on the command: tigrFreeFont(font);