mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:47:44 +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:
parent
9bb469f324
commit
96f409ec1e
9 changed files with 29 additions and 26 deletions
|
@ -9,13 +9,12 @@
|
|||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/Error.h>
|
||||
#include <AK/Function.h>
|
||||
#include <AK/RefCounted.h>
|
||||
|
||||
namespace Web {
|
||||
|
||||
class FileRequest : public RefCounted<FileRequest> {
|
||||
class FileRequest {
|
||||
public:
|
||||
explicit FileRequest(DeprecatedString path);
|
||||
FileRequest(DeprecatedString path, Function<void(ErrorOr<i32>)> on_file_request_finish);
|
||||
|
||||
DeprecatedString path() const;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue