From 21dc69ad0d3078260e536b3f1ccdd18f6f177d81 Mon Sep 17 00:00:00 2001 From: Patrick Date: Mon, 6 May 2024 01:07:39 -0400 Subject: [PATCH] Fix Vulkan deallocation race in TextureChange::Modified --- crates/yakui-vulkan/src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/yakui-vulkan/src/lib.rs b/crates/yakui-vulkan/src/lib.rs index 28468fd2..df79435e 100644 --- a/crates/yakui-vulkan/src/lib.rs +++ b/crates/yakui-vulkan/src/lib.rs @@ -611,7 +611,9 @@ impl YakuiVulkan { TextureChange::Modified => { if let Some(old) = self.yakui_managed_textures.remove(&id) { - unsafe { old.cleanup(vulkan_context.device) }; + unsafe { + self.uploads.dispose(old); + } } let new = paint.texture(id).unwrap(); let texture = VulkanTexture::from_yakui_texture(