summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc5
-rw-r--r--net/proxy/dhcp_proxy_script_fetcher_win.cc5
2 files changed, 10 insertions, 0 deletions
diff --git a/net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc b/net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc
index 2b49b94..8a405a7 100644
--- a/net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc
+++ b/net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc
@@ -41,6 +41,11 @@ DhcpProxyScriptAdapterFetcher::DhcpProxyScriptAdapterFetcher(
DhcpProxyScriptAdapterFetcher::~DhcpProxyScriptAdapterFetcher() {
Cancel();
+
+ // The WeakPtr we passed to the worker thread may be destroyed on the
+ // worker thread. This detaches any outstanding WeakPtr state from
+ // the current thread.
+ base::SupportsWeakPtr<DhcpProxyScriptAdapterFetcher>::DetachFromThread();
}
void DhcpProxyScriptAdapterFetcher::Fetch(
diff --git a/net/proxy/dhcp_proxy_script_fetcher_win.cc b/net/proxy/dhcp_proxy_script_fetcher_win.cc
index 9e34f51..64f5117 100644
--- a/net/proxy/dhcp_proxy_script_fetcher_win.cc
+++ b/net/proxy/dhcp_proxy_script_fetcher_win.cc
@@ -47,6 +47,11 @@ DhcpProxyScriptFetcherWin::DhcpProxyScriptFetcherWin(
DhcpProxyScriptFetcherWin::~DhcpProxyScriptFetcherWin() {
// Count as user-initiated if we are not yet in STATE_DONE.
Cancel();
+
+ // The WeakPtr we passed to the worker thread may be destroyed on the
+ // worker thread. This detaches any outstanding WeakPtr state from
+ // the current thread.
+ base::SupportsWeakPtr<DhcpProxyScriptFetcherWin>::DetachFromThread();
}
int DhcpProxyScriptFetcherWin::Fetch(base::string16* utf16_text,