mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-04 08:36:12 +00:00
LibWeb: Mark the task in the success steps of reading a body as mutable
Otherwise, the `move(bytes_copy)` in the body of the steps does not actually act as a `move`.
This commit is contained in:
parent
5f51a11618
commit
ec5988d56b
Notes:
sideshowbarker
2024-07-18 00:34:07 +09:00
Author: https://github.com/trflynn89
Commit: ec5988d56b
Pull-request: https://github.com/SerenityOS/serenity/pull/24124
1 changed files with 1 additions and 1 deletions
|
@ -75,7 +75,7 @@ WebIDL::ExceptionOr<void> Body::fully_read(JS::Realm& realm, Web::Fetch::Infrast
|
|||
auto success_steps = [&realm, process_body, task_destination_object = task_destination_object](ByteBuffer const& bytes) mutable -> ErrorOr<void> {
|
||||
// Make a copy of the bytes, as the source of the bytes may disappear between the time the task is queued and executed.
|
||||
auto bytes_copy = TRY(ByteBuffer::copy(bytes));
|
||||
queue_fetch_task(*task_destination_object, JS::create_heap_function(realm.heap(), [process_body, bytes_copy = move(bytes_copy)]() {
|
||||
queue_fetch_task(*task_destination_object, JS::create_heap_function(realm.heap(), [process_body, bytes_copy = move(bytes_copy)]() mutable {
|
||||
process_body->function()(move(bytes_copy));
|
||||
}));
|
||||
return {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue