From 8608063a0445a9db6944af9613ca7ff844052d1f Mon Sep 17 00:00:00 2001 From: Adrien Vasseur Date: Wed, 13 Dec 2023 12:17:32 +0000 Subject: [PATCH] Fix StandardCommandBufferAllocator deallocation in release mode (#2424) --- vulkano/src/command_buffer/allocator.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vulkano/src/command_buffer/allocator.rs b/vulkano/src/command_buffer/allocator.rs index c0dcba10..a662cfb6 100644 --- a/vulkano/src/command_buffer/allocator.rs +++ b/vulkano/src/command_buffer/allocator.rs @@ -305,9 +305,11 @@ unsafe impl CommandBufferAllocator for StandardCommandBufferAllocator { // the first place, the size of the pool for that level must have been non-zero. let buffer_reserve = pool.buffer_reserve[level as usize].as_ref().unwrap(); + let res = buffer_reserve.push(allocation.inner); + // This cannot happen because every allocation is (supposed to be) returned to the pool // whence it came, so there must be enough room for it. - debug_assert!(buffer_reserve.push(allocation.inner).is_ok()); + debug_assert!(res.is_ok()); // We have to make sure that we only reset the pool under this condition, because there // could be other references in other allocations.