Skip to content

Commit

Permalink
LibCore: Make Core::Timer::create_single_shot() create a stopped timer
Browse files Browse the repository at this point in the history
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. :^)
  • Loading branch information
awesomekling committed Dec 28, 2020
1 parent f7116bb commit add01b3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Libraries/LibCore/Timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class Timer final : public Object {
{
auto timer = adopt(*new Timer(interval, move(timeout_handler), parent));
timer->set_single_shot(true);
timer->stop();
return timer;
}

Expand Down

0 comments on commit add01b3

Please sign in to comment.