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

LibWeb: Do not use JS::Handle for mutation observers

Using JS::Handle in WebEngineCustomData means that mutation observers
will live as long as VM while actually they should be deallocated as
soon as they are no longer used in a script that created them.
This commit is contained in:
Aliaksandr Kalenik 2023-09-27 14:58:14 +02:00 committed by Andreas Kling
parent e7a3040c9f
commit 15629e8925
2 changed files with 8 additions and 2 deletions

View file

@ -49,7 +49,7 @@ struct WebEngineCustomData final : public JS::VM::CustomData {
// https://dom.spec.whatwg.org/#mutation-observer-list
// FIXME: This should be a set.
Vector<JS::Handle<DOM::MutationObserver>> mutation_observers;
Vector<JS::NonnullGCPtr<DOM::MutationObserver>> mutation_observers;
JS::Handle<JS::Realm> internal_realm;