- 
                Notifications
    
You must be signed in to change notification settings  - Fork 42
 
Description
The call to GUI_TTF_CreateFont requires the GUI_TTF_CS structure to remain in scope during the use of the TrueTypeFont after the call to this function. Further more the library is expecting that if the same font is used with multiple sizes, then the pTTF member of this structure should remain the same for each invocation of the GUI_TTF_CreateFont to take advantage of this in the caching mechanism.
In the function _CreateFonts the structure member pTTF for each instance of the font being created is being initialized with the address of TTF_Data which is located on the stack. This will go out of scope on return out of the _CreateFonts function, but it will be referenced in the future potentially leading to much badness. The TTF_Data structure should be at the same scope or longer life than the GUI_TTF_CS structure that is referencing it.