Minor ScreenManager fix

This commit is contained in:
Henrik Rydgård
2026-05-29 14:57:22 +02:00
parent de266c3d6c
commit 39e9d28b4e
+5 -3
View File
@@ -349,9 +349,11 @@ void ScreenManager::sendMessage(UIMessage message, const char *value) {
// NOTE: Changed this to send the message to all screens, instead of just the top one,
// to allow EmuScreen to receive messages from popup menus. Hope this didn't break anything..
for (const auto &iter : stack_) {
if (iter.screen) {
iter.screen->sendMessage(message, value);
// 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++) {
if (stack_[i].screen) {
stack_[i].screen->sendMessage(message, value);
}
}
}