headless-browser: Ensure IPC::File is closed after sending

On systems with the default ulimit for open files <= 256 (default
on some systems) the LibWeb tests were crashing because the
input file handles are not closed in headless-browser.
This commit is contained in:
Sebastian Zaha 2023-07-06 22:41:25 +02:00 committed by Andreas Kling
parent 59c862cab9
commit d77986f01c

View file

@ -120,7 +120,7 @@ private:
if (file.is_error())
client().async_handle_file_return(file.error().code(), {}, request_id);
else
client().async_handle_file_return(0, IPC::File(*file.value()), request_id);
client().async_handle_file_return(0, IPC::File(*file.value(), IPC::File::CloseAfterSending), request_id);
}
void notify_server_did_finish_handling_input_event(bool) override { }