mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-09 17:44:56 +09:00
LibWeb: Use a single shot timer instead of an ordinary repetitive timer
This commit is contained in:
parent
e1722d39df
commit
07b6c7114b
Notes:
sideshowbarker
2024-07-17 09:46:17 +09:00
Author: https://github.com/kennethmyhra
Commit: 07b6c7114b
Pull-request: https://github.com/SerenityOS/serenity/pull/14460
Reviewed-by: https://github.com/linusg ✅
1 changed files with 1 additions and 1 deletions
|
@ -282,7 +282,7 @@ void ResourceLoader::load(LoadRequest& request, Function<void(ReadonlyBytes, Has
|
|||
}
|
||||
|
||||
if (timeout.has_value() && timeout.value() > 0) {
|
||||
auto timer = Core::Timer::construct(timeout.value(), nullptr);
|
||||
auto timer = Core::Timer::create_single_shot(timeout.value(), nullptr);
|
||||
timer->on_timeout = [timer, protocol_request]() mutable {
|
||||
protocol_request->stop();
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue