I am working with the SFML package and receive a segmentation fault when trying to close the window/program. I have located the line in my code that results in segmentation fault, which is when I try to destroy the sf::Font used for drawing text in the SFML window.
The line is simply:
delete button_font; (which is of type sf::Font*)
What I read from the SFML documentation, the sf::Font class does have a destructor. I also tested it right after defining the font object, it destructed itself as expected.
The font is loaded by sf::Font::loadFromFile(~). It is used as argument by reference in some classes used as game states and menus. Could it be a problem that it is used by several sf::Text objects, when I try to delete the font?