fix(color): Fix infinite loop/crash with some uses of POPUP_WARNING/POPUP_INFORMATION (#3068)

Prevent infinite loop and crash if POPUP_WARNING or POPUP_INFORMATION are used from within code that is called from a 'Menu' line button.
This commit is contained in:
philmoz
2023-01-24 10:57:28 +10:00
committed by GitHub
parent 4a23f04844
commit 2d534a88cb
+5
View File
@@ -26,6 +26,11 @@ static void _run_popup_dialog(const char* title, const char* msg,
const char* info = nullptr)
{
bool running = true;
// reset input devices to avoid
// RELEASED/CLICKED to be called in a loop
lv_indev_reset(nullptr, nullptr);
auto md = new MessageDialog(MainWindow::instance(), title, msg);
md->setCloseHandler([&]() { running = false; });
if (info) {