1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 21:08:12 +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:
Aliaksandr Kalenik 2023-09-26 11:44:56 +02:00 committed by Andreas Kling
parent 73ef102b01
commit 67c727177e
6 changed files with 44 additions and 1 deletions

View file

@ -24,6 +24,7 @@ public:
virtual ~Timer() override;
void start();
void stop();
private:
Timer(JS::Object& window, i32 milliseconds, Function<void()> callback, i32 id);