mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 17:10:23 +00:00
LibWeb: Remove unnecessary JS::Handle in AbortSignal::timeout()
This fixes yet another GC reference cycle.
This commit is contained in:
parent
32d065011b
commit
f1eb837c3d
Notes:
sideshowbarker
2024-07-17 04:21:32 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/f1eb837c3d Pull-request: https://github.com/SerenityOS/serenity/pull/23815 Reviewed-by: https://github.com/ADKaster
1 changed files with 3 additions and 3 deletions
|
@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue