Ensure GPUDevice cleanup in GlobalScope

This commit is contained in:
Kunal Mohan 2020-07-17 21:15:07 +05:30
parent 37d606621d
commit 785497af63
4 changed files with 52 additions and 3 deletions

View file

@ -2069,6 +2069,13 @@ impl ScriptThread {
let global = self.documents.borrow().find_global(pipeline_id).unwrap();
global.handle_wgpu_msg(device, scope_id, result);
},
WebGPUMsg::CleanDevice {
pipeline_id,
device,
} => {
let global = self.documents.borrow().find_global(pipeline_id).unwrap();
global.remove_gpu_device(device);
},
_ => {},
}
}