mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-02 22:55:23 +00:00
LibWeb: Mark local variables captured in GC functions as ignored
These variables are all captured in queued events or other event loop tasks, but are all guarded by event loop spins later in the function. The IGNORE_USE_IN_ESCAPING_LAMBDA will soon be required for all locals that are captured by ref in GC::Function as well as AK::Function.
This commit is contained in:
committed by
Andreas Kling
parent
31d21570bf
commit
6ed2bf2bb1
@@ -475,7 +475,7 @@ WebIDL::ExceptionOr<GC::Ref<ClassicScript>> fetch_a_classic_worker_imported_scri
|
||||
auto& vm = realm.vm();
|
||||
|
||||
// 1. Let response be null.
|
||||
GC::Ptr<Fetch::Infrastructure::Response> response = nullptr;
|
||||
IGNORE_USE_IN_ESCAPING_LAMBDA GC::Ptr<Fetch::Infrastructure::Response> response = nullptr;
|
||||
|
||||
// 2. Let bodyBytes be null.
|
||||
Fetch::Infrastructure::FetchAlgorithms::BodyBytes body_bytes;
|
||||
@@ -510,6 +510,7 @@ WebIDL::ExceptionOr<GC::Ref<ClassicScript>> fetch_a_classic_worker_imported_scri
|
||||
}
|
||||
|
||||
// 5. Pause until response is not null.
|
||||
// FIXME: Consider using a "response holder" to avoid needing to annotate response as IGNORE_USE_IN_ESCAPING_LAMBDA.
|
||||
auto& event_loop = settings_object.responsible_event_loop();
|
||||
event_loop.spin_until(GC::create_function(vm.heap(), [&]() -> bool {
|
||||
return response;
|
||||
|
||||
Reference in New Issue
Block a user