From a740423e236da83092fad0efa175bfd4c50ad556 Mon Sep 17 00:00:00 2001 From: Rodrigo Tobar Date: Tue, 22 Nov 2022 23:08:56 +0800 Subject: [PATCH] PDFViewer: Prevent infinity recursion When removing all contents from the NumericInput box in PDFViewer the callback set the (empty) text again back in the box, triggering another callback in a recursive, non-stopping fashion. Not setting the text back in the box avoids the problem. --- Userland/Applications/PDFViewer/NumericInput.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Userland/Applications/PDFViewer/NumericInput.cpp b/Userland/Applications/PDFViewer/NumericInput.cpp index 3fb3e79243..fcd5769e5c 100644 --- a/Userland/Applications/PDFViewer/NumericInput.cpp +++ b/Userland/Applications/PDFViewer/NumericInput.cpp @@ -29,7 +29,6 @@ NumericInput::NumericInput() auto new_number_opt = builder.to_string().to_int(); if (!new_number_opt.has_value()) { m_needs_text_reset = true; - set_text(builder.to_string()); return; } else { m_needs_text_reset = false;