summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnotherTest <ali.mpfard@gmail.com>2020-12-31 01:12:46 +0330
committerAndreas Kling <kling@serenityos.org>2020-12-31 16:57:09 +0100
commit83fed3fd5de71c0eed7390a3cee3de6627bec3bd (patch)
treeef5272d33dd6a882db4aa869f9a01ef62e07a12b
parenta6b04cf8ef8de4b741ca8e84d32ecd44426fe994 (diff)
downloadserenity-83fed3fd5de71c0eed7390a3cee3de6627bec3bd.zip
LibWeb: Don't hold on to the Download instance after it's finished
Fixes* 4668
-rw-r--r--Libraries/LibWeb/Loader/ResourceLoader.cpp1
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);