mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-19 05:51:03 +01:00
`Buffer::destroy` freed the raw buffer of a buffer that was still mapped. So did `release_gpu_resources`, which runs `destroy` on every buffer when a device is lost or destroyed. The mapped pointer, and a `BufferView` over it, then read freed memory. A buffer that is mapped when it is destroyed now keeps what `destroy` took from it, and frees it when the buffer drops. The buffer is destroyed in every other way: it has no raw buffer to use, and `unmap` still reports it as destroyed.