diff --git a/render/vulkan/renderer.c b/render/vulkan/renderer.c index 3aa66e5c..5535cc4f 100644 --- a/render/vulkan/renderer.c +++ b/render/vulkan/renderer.c @@ -181,16 +181,16 @@ static void shared_buffer_destroy(struct wlr_vk_renderer *r, } wl_array_release(&buffer->allocs); + if (buffer->cpu_mapping) { + vkUnmapMemory(r->dev->dev, buffer->memory); + buffer->cpu_mapping = NULL; + } if (buffer->buffer) { vkDestroyBuffer(r->dev->dev, buffer->buffer, NULL); } if (buffer->memory) { vkFreeMemory(r->dev->dev, buffer->memory, NULL); } - if (buffer->cpu_mapping) { - vkUnmapMemory(r->dev->dev, buffer->memory); - buffer->cpu_mapping = NULL; - } wl_list_remove(&buffer->link); free(buffer);