Skip to content

Commit

Permalink
LibWeb: Remove unnecessary JS::Handle in AbortSignal::timeout()
Browse files Browse the repository at this point in the history
This fixes yet another GC reference cycle.
  • Loading branch information
awesomekling committed Apr 3, 2024
1 parent 58a76c1 commit 23c9006
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Userland/Libraries/LibWeb/DOM/AbortSignal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});

Expand Down

0 comments on commit 23c9006

Please sign in to comment.