Initialize Event object

This commit is contained in:
Patricia Aas 2021-06-22 10:28:23 +02:00 committed by Patricia Aas
parent 1fb5f23885
commit 9ca1f6f12d

View file

@ -37,7 +37,7 @@ void Canvas::render() {
} }
std::optional<sf::Event> Canvas::pollEvent() { std::optional<sf::Event> Canvas::pollEvent() {
sf::Event event; sf::Event event{};
if (window.pollEvent(event)) if (window.pollEvent(event))
return event; return event;
return std::nullopt; return std::nullopt;