onnxruntime
c2686abb - [webgpu] fixes buffer handle leak in cache manager (#23655)

Commit
356 days ago
[webgpu] fixes buffer handle leak in cache manager (#23655) ### Description There is a bug in the buffer cache manager that causes a buffer handle leak. When the default GPU device is destroyed, - in native, the underlying buffers are destroyed, but the handle (specifically, the `BaseBuffer` class instance in Dawn) is not released. This may cause small memory leaks. - in WebAssembly, this will cause the buffers to be leaked. Both handle (specifically, the `WGPUBufferImpl` class in emgpu) and memory will be leaked. This change fixes this bug by correctly assigning ownership of the buffers using the C++ wrapper class. Destructors will be correctly called correspondingly.
Author
Parents
Loading