From 4b526a38d82bcc2b27f6023ca741b6d06b5a6e13 Mon Sep 17 00:00:00 2001 From: Mendy Berger <12537668+MendyBerger@users.noreply.github.com> Date: Thu, 21 Nov 2024 22:21:14 -0500 Subject: [PATCH] fix: drop should delete, not push --- crates/wasi-webgpu-wasmtime/src/lib.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/wasi-webgpu-wasmtime/src/lib.rs b/crates/wasi-webgpu-wasmtime/src/lib.rs index 140cb6f..25f0e8c 100644 --- a/crates/wasi-webgpu-wasmtime/src/lib.rs +++ b/crates/wasi-webgpu-wasmtime/src/lib.rs @@ -493,7 +493,8 @@ impl webgpu::HostNonStandardBuffer for WasiWebGpuImpl { buffer.slice_mut().copy_from_slice(&val); } - fn drop(&mut self, _rep: Resource) -> wasmtime::Result<()> { + fn drop(&mut self, buffer: Resource) -> wasmtime::Result<()> { + self.table().delete(buffer).unwrap(); Ok(()) } } @@ -2189,7 +2190,7 @@ impl webgpu::HostGpuRenderBundleEncoder for WasiWebGpuImpl } fn drop(&mut self, encoder: Resource) -> wasmtime::Result<()> { - self.table().push(encoder).unwrap(); + self.table().delete(encoder).unwrap(); Ok(()) } } @@ -2218,7 +2219,7 @@ impl webgpu::HostGpuComputePipeline for WasiWebGpuImpl { } fn drop(&mut self, pipeline: Resource) -> wasmtime::Result<()> { - self.table().push(pipeline).unwrap(); + self.table().delete(pipeline).unwrap(); Ok(()) } }