From f2d6cac692a761deca8ef1151d04cb243c696eeb Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Thu, 24 Jun 2021 08:25:01 +0100 Subject: [PATCH] Solitaire: Maybe fix rare crash from completing a game with TAB (#8217) The crash happens very rarely and is hard to reproduce so it is hard to know for certain, but I am confident this fixes it. I previously delayed the start of the game-over animation by one frame, but neglected to check m_start_game_over_animation_next_frame wasn't set. This means multiple calls to start_game_over_animation() on the same frame (or rather, before the first timer_event) would each call Object::start_timer(). Now that we do check the flag, that should no longer be possible. Fixes #8122. --- Userland/Games/Solitaire/Game.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Games/Solitaire/Game.cpp b/Userland/Games/Solitaire/Game.cpp index 8bb2d3da008..e43a9bb1e54 100644 --- a/Userland/Games/Solitaire/Game.cpp +++ b/Userland/Games/Solitaire/Game.cpp @@ -85,7 +85,7 @@ void Game::set_background_fill_enabled(bool enabled) void Game::start_game_over_animation() { - if (m_game_over_animation) + if (m_game_over_animation || m_start_game_over_animation_next_frame) return; m_last_move = {};