diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-09-29 14:24:11 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-10-15 11:27:34 +0000 |
commit | 7b7a172fcdec15f3bc7ab7c006a0a28b209c5c32 (patch) | |
tree | 288cde9020579f73998a240ff9872aa0570f2bf0 | |
parent | 4d36e1a4234df9a9ce96678cb93b4f35462caded (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.
Task-number: QTBUG-96928
Change-Id: Ia5091f7398e79f835ce34dfd48f3c36859382b53
Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
(cherry picked from commit 7c35fa991f0e523e6d0901109caceed5aaac3658)
-rw-r--r-- | src/core/net/proxying_url_loader_factory_qt.cpp | 4 |
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() |