You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#36897 is an attempt to do this but it relies on interacting with a Promise from the new Drop implementation, which is unsafe when the JS context is shutting down.
Lines 1035 to 1040 in bda3700
impl Drop for DataView {
#[expect(unsafe_code)]
fn drop(&mut self) {
let cx = GlobalScope::get_cx();
assert!(unsafe {
js::jsapi::DetachArrayBuffer(*cx, self.buffer.underlying_object().handle())
, but I am starting to wonder do we need to actually call DetachArrayBuffer if arraybuffer will be GCed (or is it permarooted in SM somehow? I doubt).
GPUBuffer does not have a drop anymore, but DataView still has. But that is tracked in #45504
Activity
sagudev commentedon Jul 1, 2026
There is also
servo/components/script/dom/bindings/buffer_source.rs
Lines 1035 to 1040 in bda3700
sagudev commentedon Jul 9, 2026
GPUBuffer does not have a drop anymore, but DataView still has. But that is tracked in #45504
jdm commentedon Jul 9, 2026
Not true:
servo/components/script/dom/webgpu/gpubuffer.rs
Lines 190 to 203 in 9944764
We should move that to the Droppable pattern from other types and remove
servo/components/script_bindings/codegen/Bindings.conf
Line 494 in 9944764
sagudev commentedon Jul 9, 2026
Right
webgpu: Proper cleanup in GPUBuffer (servo#46415)