summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@gmail.com>2021-06-24 08:25:01 +0100
committerGitHub <noreply@github.com>2021-06-24 09:25:01 +0200
commitf2d6cac692a761deca8ef1151d04cb243c696eeb (patch)
tree525f24521f62085e8899905d13a5faa7880afc8e /Userland
parentbd5a04fffeb96b42e5aa085ff35cd92b0fc6e332 (diff)
downloadserenity-f2d6cac692a761deca8ef1151d04cb243c696eeb.zip
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.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Games/Solitaire/Game.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Games/Solitaire/Game.cpp b/Userland/Games/Solitaire/Game.cpp
index 8bb2d3da00..e43a9bb1e5 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 = {};