|
al_load_ttf_font_f crash |
Hyena_
Member #8,852
July 2007
|
ALLEGRO_FILE *memfile = al_open_memfile(buffer, file_size, "rb"); std::string fn = file_name; fn.append(file_type); f = al_load_ttf_font_f(memfile, fn.c_str(), size, flags); //al_fclose(memfile);
Note that I have commented out al_fclose(memfile); http://www.allegro.cc/manual/5/al_load_ttf_font_f To my understanding, the note says that I am not supposed to free buffer. So do I get it right - I must not al_fclose the memfile and I must not al_free the buffer?
|
Matthew Leverton
Supreme Loser
January 1999
|
Hyena_ said: So do I get it right - I must not al_fclose the memfile and I must not al_free the buffer? Right. Of course, you must still free the memory after you destroy the font. (Check the source to see if it closes the file for you.) |
Hyena_
Member #8,852
July 2007
|
Thanks. Do I have to al_fclose the memfile too after having freed the memory?
|
Thomas Fjellstrom
Member #476
June 2000
|
you want to close it before freeing the memory I think. -- |
|