summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2021-09-29 14:24:11 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2021-10-06 11:04:47 +0200
commit7c35fa991f0e523e6d0901109caceed5aaac3658 (patch)
treea7518302c59ca3aaf337da40a768f7ebfc08992e
parent69baa6b0b9f2fe77f032804ee2376a9b0d6fedfa (diff)
Do not wait on weak_pointer for termination errors
We invalidate the weak pointer factory before waiting on the error callback, meaning it will never come. Pick-to: 6.2 5.15 Task-number: QTBUG-96928 Change-Id: Ia5091f7398e79f835ce34dfd48f3c36859382b53 Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
-rw-r--r--src/core/net/proxying_url_loader_factory_qt.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/net/proxying_url_loader_factory_qt.cpp b/src/core/net/proxying_url_loader_factory_qt.cpp
index c945ee4d5..c73da1455 100644
--- a/src/core/net/proxying_url_loader_factory_qt.cpp
+++ b/src/core/net/proxying_url_loader_factory_qt.cpp
@@ -208,9 +208,9 @@ InterceptedRequest::InterceptedRequest(ProfileAdapter *profile_adapter,
current_response_ = network::mojom::URLResponseHead::New();
// If there is a client error, clean up the request.
target_client_.set_disconnect_handler(
- base::BindOnce(&InterceptedRequest::OnURLLoaderClientError, weak_factory_.GetWeakPtr()));
+ base::BindOnce(&InterceptedRequest::OnURLLoaderClientError, base::Unretained(this)));
proxied_loader_receiver_.set_disconnect_with_reason_handler(
- base::BindOnce(&InterceptedRequest::OnURLLoaderError, weak_factory_.GetWeakPtr()));
+ base::BindOnce(&InterceptedRequest::OnURLLoaderError, base::Unretained(this)));
}
InterceptedRequest::~InterceptedRequest()