mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02: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:
committed by
Andrew Kaster
parent
21097d1c9e
commit
bed4af6fef
Notes:
sideshowbarker
2024-07-17 05:13:53 +09:00
Author: https://github.com/DanShaders Commit: https://github.com/SerenityOS/serenity/commit/bed4af6fef Pull-request: https://github.com/SerenityOS/serenity/pull/23149 Reviewed-by: https://github.com/ADKaster ✅
@@ -509,11 +509,11 @@ int EventLoopManagerUnix::register_timer(EventReceiver& object, int milliseconds
|
||||
return timer_id;
|
||||
}
|
||||
|
||||
bool EventLoopManagerUnix::unregister_timer(int timer_id)
|
||||
void EventLoopManagerUnix::unregister_timer(int timer_id)
|
||||
{
|
||||
auto& thread_data = ThreadData::the();
|
||||
thread_data.id_allocator.deallocate(timer_id);
|
||||
return thread_data.timers.remove(timer_id);
|
||||
VERIFY(thread_data.timers.remove(timer_id));
|
||||
}
|
||||
|
||||
void EventLoopManagerUnix::register_notifier(Notifier& notifier)
|
||||
|
||||
Reference in New Issue
Block a user