I’ve recently started using SFML and noticed that there aren’t any kinds of “FreeResource” methods provided. For example, sf::Font has a function called LoadFromFile, but no functions to release the resource.
I thought this was very odd. Am I missing something? Is my only option to create an sf::Font pointer and dynamically allocate and delete it?
sf::Fontstores its font data in astd::mapcalled myGlyphs (see the source). When Font’s destructor is called, everything in that map will be freed automatically (by thestd::mapdestructor).