From 95a0cc8f9a69aee5f281606cc63b034fa7c02e54 Mon Sep 17 00:00:00 2001 From: grorp Date: Sat, 3 Aug 2024 18:48:25 +0200 Subject: [PATCH] Avoid infinite recursion with unhandled second touch (#14915) --- src/gui/modalMenu.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/modalMenu.cpp b/src/gui/modalMenu.cpp index bd8358b62..83d5036f9 100644 --- a/src/gui/modalMenu.cpp +++ b/src/gui/modalMenu.cpp @@ -319,6 +319,11 @@ bool GUIModalMenu::preprocessEvent(const SEvent &event) } #endif + // If the second touch arrives here again, that means nobody handled it. + // Abort to avoid infinite recursion. + if (m_second_touch) + return true; + // Convert touch events into mouse events. if (event.EventType == EET_TOUCH_INPUT_EVENT) { irr_ptr holder;