[deno] Fix dropping of command encoders/buffers, and an enum typo (#7808)

Fixes #7797
This commit is contained in:
Andy Leiserson authored and GitHub committed 2025-06-16 10:50:19 -07:00
1 parent 371c8fd1db
commit afa0f71736
6 files changed
+35 -24

No files matched your search

+1 -7
View File
@@ -1,7 +1,5 @@
// Copyright 2018-2025 the Deno authors. MIT license.
use std::cell::OnceCell;
use deno_core::op2;
use deno_core::GarbageCollected;
use deno_core::WebIDL;
@@ -12,15 +10,11 @@ pub struct GPUCommandBuffer {
pub instance: Instance,
pub id: wgpu_core::id::CommandBufferId,
pub label: String,
pub consumed: OnceCell<()>,
}
impl Drop for GPUCommandBuffer {
fn drop(&mut self) {
if self.consumed.get().is_none() {
self.instance.command_buffer_drop(self.id);
}
self.instance.command_buffer_drop(self.id);
}
}