LibWeb: Remove unnecessary JS::Handle in AbortSignal::timeout()

This fixes yet another GC reference cycle.
This commit is contained in:
Andreas Kling 2024-04-03 12:50:39 +02:00
parent 32d065011b
commit f1eb837c3d

View file

@ -138,11 +138,11 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<AbortSignal>> AbortSignal::timeout(JS::VM&
VERIFY(window_or_worker);
// 3. Run steps after a timeout given global, "AbortSignal-timeout", milliseconds, and the following step:
window_or_worker->run_steps_after_a_timeout(milliseconds, [&realm, &global, strong_signal = JS::make_handle(signal)]() {
window_or_worker->run_steps_after_a_timeout(milliseconds, [&realm, &global, signal]() {
// 1. Queue a global task on the timer task source given global to signal abort given signal and a new "TimeoutError" DOMException.
HTML::queue_global_task(HTML::Task::Source::TimerTask, global, [&realm, &strong_signal]() mutable {
HTML::queue_global_task(HTML::Task::Source::TimerTask, global, [&realm, signal]() mutable {
auto reason = WebIDL::TimeoutError::create(realm, "Signal timed out"_fly_string);
strong_signal->signal_abort(reason);
signal->signal_abort(reason);
});
});