LibWeb: Mark Navigable as destroyed in destroy_top_level_traversable AO

Without this, a top level traversable might show up in settings we don't
want it to when accessing all_navigables, such as choose a navigable.
This commit is contained in:
Andrew Kaster 2024-02-12 17:36:38 -07:00 committed by Andreas Kling
parent a0e7af0cd9
commit 2b3bc2654f
Notes: sideshowbarker 2024-07-17 07:43:05 +09:00

View File

@ -917,6 +917,11 @@ void TraversableNavigable::destroy_top_level_traversable()
// 5. Remove traversable from the user agent's top-level traversable set.
user_agent_top_level_traversable_set().remove(this);
// FIXME: Figure out why we need to do this... we shouldn't be leaking Navigables for all time.
// However, without this, we can keep stale destroyed traversables around.
set_has_been_destroyed();
all_navigables().remove(this);
}
// https://html.spec.whatwg.org/multipage/browsing-the-web.html#finalize-a-same-document-navigation