diff options
author | AnotherTest <ali.mpfard@gmail.com> | 2020-12-31 01:12:46 +0330 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-12-31 16:57:09 +0100 |
commit | 83fed3fd5de71c0eed7390a3cee3de6627bec3bd (patch) | |
tree | ef5272d33dd6a882db4aa869f9a01ef62e07a12b | |
parent | a6b04cf8ef8de4b741ca8e84d32ecd44426fe994 (diff) | |
download | serenity-83fed3fd5de71c0eed7390a3cee3de6627bec3bd.zip |
LibWeb: Don't hold on to the Download instance after it's finished
Fixes* 4668
-rw-r--r-- | Libraries/LibWeb/Loader/ResourceLoader.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Libraries/LibWeb/Loader/ResourceLoader.cpp b/Libraries/LibWeb/Loader/ResourceLoader.cpp index 333237e7d9..4d3de8480a 100644 --- a/Libraries/LibWeb/Loader/ResourceLoader.cpp +++ b/Libraries/LibWeb/Loader/ResourceLoader.cpp @@ -184,6 +184,7 @@ void ResourceLoader::load(const LoadRequest& request, Function<void(ReadonlyByte error_callback("HTTP load failed"); return; } + deferred_invoke([&](auto&) { const_cast<RefPtr<Protocol::Download>&>(download) = nullptr; }); success_callback(payload, response_headers); }; download->set_should_buffer_all_input(true); |