mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 09:57:35 +00:00
LibCore+Ladybird: Make unregistering timer infallible
Let's force calling code to provide valid timer ids. No code changes are required since, surprise, nobody used this obscure functionality.
This commit is contained in:
parent
21097d1c9e
commit
bed4af6fef
10 changed files with 17 additions and 23 deletions
|
@ -109,11 +109,11 @@ int EventLoopManagerQt::register_timer(Core::EventReceiver& object, int millisec
|
|||
return timer_id;
|
||||
}
|
||||
|
||||
bool EventLoopManagerQt::unregister_timer(int timer_id)
|
||||
void EventLoopManagerQt::unregister_timer(int timer_id)
|
||||
{
|
||||
auto& thread_data = ThreadData::the();
|
||||
thread_data.timer_id_allocator.deallocate(timer_id);
|
||||
return thread_data.timers.remove(timer_id);
|
||||
VERIFY(thread_data.timers.remove(timer_id));
|
||||
}
|
||||
|
||||
static void qt_notifier_activated(Core::Notifier& notifier)
|
||||
|
|
|
@ -27,7 +27,7 @@ public:
|
|||
virtual NonnullOwnPtr<Core::EventLoopImplementation> make_implementation() override;
|
||||
|
||||
virtual int register_timer(Core::EventReceiver&, int milliseconds, bool should_reload, Core::TimerShouldFireWhenNotVisible) override;
|
||||
virtual bool unregister_timer(int timer_id) override;
|
||||
virtual void unregister_timer(int timer_id) override;
|
||||
|
||||
virtual void register_notifier(Core::Notifier&) override;
|
||||
virtual void unregister_notifier(Core::Notifier&) override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue