From add01b304b282049154786b9c070f83ff3b6fc71 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 28 Dec 2020 20:47:46 +0100 Subject: [PATCH] LibCore: Make Core::Timer::create_single_shot() create a stopped timer None of the code using this actually expected the timer to fire right away, but they would instead call start() on it once they were ready to accept a timer fire. Let's make the API behave the way its clients believed it did. :^) --- Libraries/LibCore/Timer.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Libraries/LibCore/Timer.h b/Libraries/LibCore/Timer.h index 33855873a1f..04f41e39a01 100644 --- a/Libraries/LibCore/Timer.h +++ b/Libraries/LibCore/Timer.h @@ -39,6 +39,7 @@ public: { auto timer = adopt(*new Timer(interval, move(timeout_handler), parent)); timer->set_single_shot(true); + timer->stop(); return timer; }