diff --git a/UI/GameScreen.cpp b/UI/GameScreen.cpp index 8863afd992..f5710f9034 100644 --- a/UI/GameScreen.cpp +++ b/UI/GameScreen.cpp @@ -443,6 +443,8 @@ void SetBackgroundPopupScreen::update() { UI::EventReturn GameScreen::OnSetBackground(UI::EventParams &e) { I18NCategory *ga = GetI18NCategory("Game"); + // This popup is used to prevent any race condition: + // g_gameInfoCache may take time to load the data, and a crash could happen if they exit before then. SetBackgroundPopupScreen *pop = new SetBackgroundPopupScreen(ga->T("Setting Background"), gamePath_); if (e.v) pop->SetPopupOrigin(e.v);