LibWeb: Remove some uses of [&] lambda captures for queued tasks

Using a default reference capture for these kinds of tasks is dangerous
and prone to error. Some of the variables should for sure be captured
by value so that we can keep a GC object alive rather than trying to
refer to stack objects.
This commit is contained in:
Andrew Kaster 2024-12-09 19:48:50 -07:00 committed by Andreas Kling
commit 66519af43f
Notes: github-actions[bot] 2024-12-10 06:14:03 +00:00
4 changed files with 10 additions and 10 deletions

View file

@ -890,7 +890,7 @@ static WebIDL::ExceptionOr<Navigable::NavigationParamsVariant> create_navigation
}
// 7. Wait until either response is non-null, or navigable's ongoing navigation changes to no longer equal navigationId.
HTML::main_thread_event_loop().spin_until(GC::create_function(vm.heap(), [&]() {
HTML::main_thread_event_loop().spin_until(GC::create_function(vm.heap(), [navigation_id, navigable, response_holder]() {
if (response_holder->response() != nullptr)
return true;