mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 21:12:08 +02: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:
Notes:
sideshowbarker
2024-07-17 03:35:24 +09:00
Author: https://github.com/Lubrsi Commit: https://github.com/SerenityOS/serenity/commit/7550b4175e Pull-request: https://github.com/SerenityOS/serenity/pull/20462
@@ -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