Bezier-rs: Fix crash when outlining a small bézier (#1958)

Fix crash when outlining small bézier
This commit is contained in:
James Lindsay 2024-09-05 18:22:24 +01:00 committed by Keavon Chambers
parent 9524835a30
commit bf5019db7b
2 changed files with 42 additions and 8 deletions

View file

@ -164,14 +164,12 @@ async fn execute_shader<I: Pod + Send + Sync, O: Pod + Send + Sync>(device: Arc<
// Since contents are got in bytes, this converts these bytes back to u32
let result = bytemuck::cast_slice(&data).to_vec();
// With the current interface, we have to make sure all mapped views are
// dropped before we unmap the buffer.
// With the current interface, we have to make sure all mapped views are dropped before we unmap the buffer
drop(data);
staging_buffer.unmap(); // Unmaps buffer from memory
// If you are familiar with C++ these 2 lines can be thought of similarly to:
// delete myPointer;
// myPointer = NULL;
// It effectively frees the memory
// Unmaps buffer from memory
staging_buffer.unmap();
// If you are familiar with C++ these 2 lines can be thought of similarly to `delete myPointer; myPointer = NULL;`.
// It effectively frees the memory.
// Returns data from buffer
Some(result)