Hello folks -
I've been working with SFML for a little over a month now, and have recently run into a bizarre issue that might be the result of a bug in the SFML library. I have a test program with a "main" function as follows:
int main()
{
try
{
Foo foo("Foo!");
CommandProcessor bar;
sf::RenderWindow window(sf::VideoMode(640, 480), "Test", sf::Style::Close);
while(window.isOpen())
{
sf::Event event;
while(window.pollEvent(event))
{
bar.processEvent(event);
if(event.type == sf::Event::Closed)
{
std::cout << "preparing to close" << std::endl;
window.close();
std::cout << "close requested" << std::endl;
}
}
}
}
catch(std::exception& e)
{
std::cout << "Unhandled exception - terminating program" << std::endl;
std::cout << e.what() << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
When I close the window via the button on the top right, I get the following text in the console:
preparing to close
close requested
after which the program hangs and I get the typical Windows "Program has stopped working [close button]" popup. Given the text in the console I have no idea how this could be happening unless, for some reason, the RenderWindow's close function is bugged. Is anyone able to offer advice? Thanks!
Environment (more added by request):