1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:17:35 +00:00

LibWeb: Unregister AnimationTimeline from document in finalize()

...instead of destructor because by the time it is executed, document
could already be destroyed.
This commit is contained in:
Aliaksandr Kalenik 2024-03-11 15:17:17 +01:00 committed by Andreas Kling
parent bcdf4a375d
commit 2129c5d8b0
2 changed files with 2 additions and 2 deletions

View file

@ -48,7 +48,7 @@ AnimationTimeline::AnimationTimeline(JS::Realm& realm)
{ {
} }
AnimationTimeline::~AnimationTimeline() void AnimationTimeline::finalize()
{ {
if (m_associated_document) if (m_associated_document)
m_associated_document->disassociate_with_timeline(*this); m_associated_document->disassociate_with_timeline(*this);

View file

@ -35,10 +35,10 @@ public:
protected: protected:
AnimationTimeline(JS::Realm&); AnimationTimeline(JS::Realm&);
virtual ~AnimationTimeline() override;
virtual void initialize(JS::Realm&) override; virtual void initialize(JS::Realm&) override;
virtual void visit_edges(Cell::Visitor&) override; virtual void visit_edges(Cell::Visitor&) override;
virtual void finalize() override;
// https://www.w3.org/TR/web-animations-1/#dom-animationtimeline-currenttime // https://www.w3.org/TR/web-animations-1/#dom-animationtimeline-currenttime
Optional<double> m_current_time {}; Optional<double> m_current_time {};