LibWeb: Increase completed jobs number even if navigable is destroyed

...otherwise spin_until() will stuck waiting.
This commit is contained in:
Aliaksandr Kalenik 2024-04-05 02:46:32 +02:00 committed by Andreas Kling
parent aefed21927
commit db31fa730a
Notes: sideshowbarker 2024-07-17 22:55:25 +09:00

View file

@ -454,8 +454,10 @@ TraversableNavigable::HistoryStepResult TraversableNavigable::apply_the_history_
for (auto& navigable : changing_navigables) {
queue_global_task(Task::Source::NavigationAndTraversal, *navigable->active_window(), [&] {
// NOTE: This check is not in the spec but we should not continue navigation if navigable has been destroyed.
if (navigable->has_been_destroyed())
if (navigable->has_been_destroyed()) {
completed_change_jobs++;
return;
}
// 1. Let displayedEntry be navigable's active session history entry.
auto displayed_entry = navigable->active_session_history_entry();