aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom
diff options
context:
space:
mode:
authorKunal Mohan <kunalmohan99@gmail.com>2020-07-17 21:15:07 +0530
committerKunal Mohan <kunalmohan99@gmail.com>2020-07-17 21:17:38 +0530
commit785497af63bb34b35e9f0c2b3f7f2eca70ff641b (patch)
tree1a13d9b68640ec61e01999080a592fb6ae412c4e /components/script/dom
parent37d606621d5ece13642fbe25a91ff56e2df7166d (diff)
downloadservo-785497af63bb34b35e9f0c2b3f7f2eca70ff641b.tar.gz
servo-785497af63bb34b35e9f0c2b3f7f2eca70ff641b.zip
Ensure GPUDevice cleanup in GlobalScope
Diffstat (limited to 'components/script/dom')
-rw-r--r--components/script/dom/globalscope.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/components/script/dom/globalscope.rs b/components/script/dom/globalscope.rs
index 7b2d7ec25a0..5db5942fe0d 100644
--- a/components/script/dom/globalscope.rs
+++ b/components/script/dom/globalscope.rs
@@ -2954,6 +2954,10 @@ impl GlobalScope {
.insert(device.id(), Dom::from_ref(device));
}
+ pub fn remove_gpu_device(&self, device: WebGPUDevice) {
+ let _ = self.gpu_devices.borrow_mut().remove(&device);
+ }
+
pub fn handle_wgpu_msg(&self, device: WebGPUDevice, scope: u64, result: WebGPUOpResult) {
let result = match result {
WebGPUOpResult::Success => Ok(()),