From 873469378d18c84929640ec955ab3ffd68c67b3d Mon Sep 17 00:00:00 2001 From: hodasemi Date: Thu, 11 May 2023 19:50:22 +0200 Subject: [PATCH] Destroy VMA on drop --- vma-rs/src/allocator.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vma-rs/src/allocator.rs b/vma-rs/src/allocator.rs index 97766ef..2162533 100644 --- a/vma-rs/src/allocator.rs +++ b/vma-rs/src/allocator.rs @@ -169,3 +169,11 @@ impl Allocator { AllocatorBuilder::default() } } + +impl Drop for Allocator { + fn drop(&mut self) { + unsafe { + vmaDestroyAllocator(self.allocator); + } + } +}