1
0
Fork 0
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:
Kenneth Myhra 2022-07-02 22:15:43 +02:00 committed by Linus Groh
parent e1722d39df
commit 07b6c7114b
Notes: sideshowbarker 2024-07-17 09:46:17 +09:00

View file

@ -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();
};