mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-31 13:48:25 +00:00
LibWeb: Clear all active timers when document is destroyed
This change implements a step from the document's destroy procedure in the specification, saying that all active timers should be cleared. By doing this, we also fix the leaking of a document in case where we have navigated away from a page that has scheduled timers that haven't yet been triggered.
This commit is contained in:
committed by
Andreas Kling
parent
73ef102b01
commit
67c727177e
@@ -34,6 +34,7 @@ void Timer::visit_edges(Cell::Visitor& visitor)
|
||||
|
||||
Timer::~Timer()
|
||||
{
|
||||
VERIFY(!m_timer->is_active());
|
||||
}
|
||||
|
||||
void Timer::start()
|
||||
@@ -41,4 +42,9 @@ void Timer::start()
|
||||
m_timer->start();
|
||||
}
|
||||
|
||||
void Timer::stop()
|
||||
{
|
||||
m_timer->stop();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user