mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
LibWeb: Unregister IntersectionObserver in finalize, not the destructor
Otherwise it UAFs the intersection root. Not sure how this didn't cause a lot of crashes!
This commit is contained in:
@@ -53,7 +53,9 @@ IntersectionObserver::IntersectionObserver(JS::Realm& realm, JS::GCPtr<WebIDL::C
|
||||
});
|
||||
}
|
||||
|
||||
IntersectionObserver::~IntersectionObserver()
|
||||
IntersectionObserver::~IntersectionObserver() = default;
|
||||
|
||||
void IntersectionObserver::finalize()
|
||||
{
|
||||
intersection_root().visit([this](auto& node) {
|
||||
node->document().unregister_intersection_observer({}, *this);
|
||||
|
||||
Reference in New Issue
Block a user