From 2129c5d8b053d8aaf759e96f85f768da89684f82 Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Mon, 11 Mar 2024 15:17:17 +0100 Subject: [PATCH] LibWeb: Unregister AnimationTimeline from document in finalize() ...instead of destructor because by the time it is executed, document could already be destroyed. --- Userland/Libraries/LibWeb/Animations/AnimationTimeline.cpp | 2 +- Userland/Libraries/LibWeb/Animations/AnimationTimeline.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/Animations/AnimationTimeline.cpp b/Userland/Libraries/LibWeb/Animations/AnimationTimeline.cpp index 7d29b9b8bd..2e419d72ef 100644 --- a/Userland/Libraries/LibWeb/Animations/AnimationTimeline.cpp +++ b/Userland/Libraries/LibWeb/Animations/AnimationTimeline.cpp @@ -48,7 +48,7 @@ AnimationTimeline::AnimationTimeline(JS::Realm& realm) { } -AnimationTimeline::~AnimationTimeline() +void AnimationTimeline::finalize() { if (m_associated_document) m_associated_document->disassociate_with_timeline(*this); diff --git a/Userland/Libraries/LibWeb/Animations/AnimationTimeline.h b/Userland/Libraries/LibWeb/Animations/AnimationTimeline.h index 0926045f18..8ef4c156b5 100644 --- a/Userland/Libraries/LibWeb/Animations/AnimationTimeline.h +++ b/Userland/Libraries/LibWeb/Animations/AnimationTimeline.h @@ -35,10 +35,10 @@ public: protected: AnimationTimeline(JS::Realm&); - virtual ~AnimationTimeline() override; virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; + virtual void finalize() override; // https://www.w3.org/TR/web-animations-1/#dom-animationtimeline-currenttime Optional m_current_time {};