1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 03:08:13 +00:00

LibWeb+WebContent: Do not reference-count file request objects

There is currently a memory leak with these file request objects due to
the callback on_file_request_finish referencing itself in its capture
list. This object does not need to be reference counted or allocated on
the heap. It is only ever stored in a HashMap until a response is
received from the browser, and it is not shared.
This commit is contained in:
Timothy Flynn 2023-01-30 16:35:47 -05:00 committed by Linus Groh
parent 9bb469f324
commit 96f409ec1e
9 changed files with 29 additions and 26 deletions

View file

@ -373,9 +373,9 @@ void PageHost::page_did_update_resource_count(i32 count_waiting)
m_client.async_did_update_resource_count(count_waiting);
}
void PageHost::request_file(NonnullRefPtr<Web::FileRequest>& file_request)
void PageHost::request_file(Web::FileRequest file_request)
{
m_client.request_file(file_request);
m_client.request_file(move(file_request));
}
}