Module: wine Branch: master Commit: 4e7be889904152183b349d5e33d862fe659c1806 URL: https://source.winehq.org/git/wine.git/?a=commit;h=4e7be889904152183b349d5e3... Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Mon Dec 14 18:15:20 2020 +0330 wined3d: Only clear "map_ptr" if the memory was unmapped in wined3d_allocator_chunk_vk_unmap(). Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/context_vk.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/context_vk.c b/dlls/wined3d/context_vk.c index 66f5109dc87..1b937dd3b21 100644 --- a/dlls/wined3d/context_vk.c +++ b/dlls/wined3d/context_vk.c @@ -277,8 +277,10 @@ void wined3d_allocator_chunk_vk_unmap(struct wined3d_allocator_chunk_vk *chunk_v TRACE("chunk_vk %p, context_vk %p.\n", chunk_vk, context_vk); - if (!--chunk_vk->c.map_count) - VK_CALL(vkUnmapMemory(device_vk->vk_device, chunk_vk->vk_memory)); + if (--chunk_vk->c.map_count) + return; + + VK_CALL(vkUnmapMemory(device_vk->vk_device, chunk_vk->vk_memory)); chunk_vk->c.map_ptr = NULL; }