1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:38:11 +00:00

LibWeb: Weakly store a reference to the Window object in timer tasks

This prevents a crash when refreshing or navigating away from the Acid3
test page while it is actively running.
This commit is contained in:
Timothy Flynn 2022-03-24 16:09:09 -04:00 committed by Andreas Kling
parent 02004b7055
commit 430559ea51
2 changed files with 13 additions and 5 deletions

View file

@ -10,6 +10,7 @@
#include <AK/IDAllocator.h>
#include <AK/RefCounted.h>
#include <AK/RefPtr.h>
#include <AK/Weakable.h>
#include <LibWeb/Bindings/WindowObject.h>
#include <LibWeb/Bindings/Wrappable.h>
#include <LibWeb/CSS/MediaQueryList.h>
@ -26,6 +27,7 @@ class RequestAnimationFrameCallback;
class Window final
: public RefCounted<Window>
, public Weakable<Window>
, public DOM::EventTarget
, public HTML::GlobalEventHandlers {
public: