1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-30 21:58:10 +00:00

LibWeb: Deallocate DOM timer ID's when the timer goes away

I left a page open overnight and it had run out of timer ID's. :^)
This commit is contained in:
Andreas Kling 2020-11-30 08:03:13 +01:00
parent 8b194f41e9
commit 113da74683
3 changed files with 7 additions and 0 deletions

View file

@ -108,6 +108,11 @@ i32 Window::allocate_timer_id(Badge<Timer>)
return m_timer_id_allocator.allocate();
}
void Window::deallocate_timer_id(Badge<Timer>, i32 id)
{
m_timer_id_allocator.deallocate(id);
}
void Window::clear_timeout(i32 timer_id)
{
m_timers.remove(timer_id);