From b99b6ed65f66b4630bdc2b407a97bd0e526165d3 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 29 Sep 2021 14:24:11 +0200 Subject: 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 (cherry picked from commit 7c35fa991f0e523e6d0901109caceed5aaac3658) Reviewed-by: Qt Cherry-pick Bot --- src/core/net/proxying_url_loader_factory_qt.cpp | 4 ++-- 1 file 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 fe9176f1f..75fc15e6b 100644 --- a/src/core/net/proxying_url_loader_factory_qt.cpp +++ b/src/core/net/proxying_url_loader_factory_qt.cpp @@ -207,9 +207,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() -- cgit v1.2.1