1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:57:35 +00:00

LibWeb: Use Core::Timer instead of Platform::Timer in HTML::Timer

By using Core::Timer that accepts Function instead of JS::SafeFunction
in Platform::Timer does we fix memory leak caused by circular
dependency of timer's callback and timer itself.
This commit is contained in:
Aliaksandr Kalenik 2023-09-26 11:53:37 +02:00 committed by Andreas Kling
parent 67c727177e
commit 883a97984c
2 changed files with 4 additions and 4 deletions

View file

@ -31,7 +31,7 @@ private:
virtual void visit_edges(Cell::Visitor&) override;
RefPtr<Platform::Timer> m_timer;
RefPtr<Core::Timer> m_timer;
JS::NonnullGCPtr<JS::Object> m_window_or_worker_global_scope;
Function<void()> m_callback;
i32 m_id { 0 };