From 640a46588d7e2feb08625184e03c8c0f25373a5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Wed, 8 Jul 2026 11:16:09 +0200 Subject: [PATCH] Fix hang on "More settings...". Fixes #21893 --- Common/UI/Screen.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Common/UI/Screen.cpp b/Common/UI/Screen.cpp index d85a1ef823..4ec2b48009 100644 --- a/Common/UI/Screen.cpp +++ b/Common/UI/Screen.cpp @@ -392,7 +392,10 @@ void ScreenManager::sendMessage(UIMessage message, const char *value) { // to allow EmuScreen to receive messages from popup menus. Hope this didn't break anything.. // NOTE: We do not use the iterator solution here, because the screen array may change by sendMessage! // Although if it does, that's very bad. - for (int i = 0; i < stack_.size(); i++) { + // We also pick out the stack size before, so we don't get infinite growth if a screen is pushed from the handler. + // We probably should delay pushes, though... + const size_t stack_size = stack_.size(); + for (int i = 0; i < stack_size; i++) { if (stack_[i].screen) { stack_[i].screen->sendMessage(message, value); }