Skip to content

Commit

Permalink
fix: drop should delete, not push
Browse files Browse the repository at this point in the history
  • Loading branch information
MendyBerger committed Nov 22, 2024
1 parent 7f9bec9 commit 4b526a3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions crates/wasi-webgpu-wasmtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,8 @@ impl<T: WasiWebGpuView> webgpu::HostNonStandardBuffer for WasiWebGpuImpl<T> {
buffer.slice_mut().copy_from_slice(&val);
}

fn drop(&mut self, _rep: Resource<webgpu::NonStandardBuffer>) -> wasmtime::Result<()> {
fn drop(&mut self, buffer: Resource<webgpu::NonStandardBuffer>) -> wasmtime::Result<()> {
self.table().delete(buffer).unwrap();
Ok(())
}
}
Expand Down Expand Up @@ -2189,7 +2190,7 @@ impl<T: WasiWebGpuView> webgpu::HostGpuRenderBundleEncoder for WasiWebGpuImpl<T>
}

fn drop(&mut self, encoder: Resource<webgpu::GpuRenderBundleEncoder>) -> wasmtime::Result<()> {
self.table().push(encoder).unwrap();
self.table().delete(encoder).unwrap();
Ok(())
}
}
Expand Down Expand Up @@ -2218,7 +2219,7 @@ impl<T: WasiWebGpuView> webgpu::HostGpuComputePipeline for WasiWebGpuImpl<T> {
}

fn drop(&mut self, pipeline: Resource<webgpu::GpuComputePipeline>) -> wasmtime::Result<()> {
self.table().push(pipeline).unwrap();
self.table().delete(pipeline).unwrap();
Ok(())
}
}
Expand Down

0 comments on commit 4b526a3

Please sign in to comment.