aboutsummaryrefslogtreecommitdiffstats
path: root/components/net/resource_thread.rs
diff options
context:
space:
mode:
authorGregory Terzian <gterzian@users.noreply.github.com>2020-05-27 17:10:54 +0800
committerGregory Terzian <gterzian@users.noreply.github.com>2020-05-30 21:04:34 +0800
commitfa765168b9d14c08950515774e78851aeffacfe2 (patch)
tree9a0b18ec6d42d5f16055f2b18e52f18fa21fece2 /components/net/resource_thread.rs
parent34a41f57c66d42225f28e62f02c337b46d0e3593 (diff)
downloadservo-fa765168b9d14c08950515774e78851aeffacfe2.tar.gz
servo-fa765168b9d14c08950515774e78851aeffacfe2.zip
net: shutdown async runtime on exit
Diffstat (limited to 'components/net/resource_thread.rs')
-rw-r--r--components/net/resource_thread.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/components/net/resource_thread.rs b/components/net/resource_thread.rs
index 388cacc77af..28a397e78e6 100644
--- a/components/net/resource_thread.rs
+++ b/components/net/resource_thread.rs
@@ -152,7 +152,7 @@ fn create_http_states(
http_cache_state: Mutex::new(HashMap::new()),
client: create_http_client(
create_tls_config(&certs, ALPN_H2_H1),
- HANDLE.lock().unwrap().executor(),
+ HANDLE.lock().unwrap().as_ref().unwrap().executor(),
),
};
@@ -165,7 +165,7 @@ fn create_http_states(
http_cache_state: Mutex::new(HashMap::new()),
client: create_http_client(
create_tls_config(&certs, ALPN_H2_H1),
- HANDLE.lock().unwrap().executor(),
+ HANDLE.lock().unwrap().as_ref().unwrap().executor(),
),
};
@@ -591,6 +591,9 @@ impl CoreResourceManager {
// or a short timeout has been reached.
self.thread_pool.exit();
+ // Shut-down the async runtime used by fetch workers.
+ drop(HANDLE.lock().unwrap().take());
+
debug!("Exited CoreResourceManager");
}