Plug a memory leak

A function with ensure in the name would better check if the
thing it is supposed to ensure already exists.
This commit is contained in:
Matthias Clasen 2017-09-24 21:34:53 -04:00
parent 00f8a11aec
commit b5ac277654

View File

@ -299,7 +299,8 @@ static void
gsk_vulkan_image_ensure_view (GskVulkanImage *self,
VkFormat format)
{
GSK_VK_CHECK (vkCreateImageView, gdk_vulkan_context_get_device (self->vulkan),
if (self->vk_image_view == VK_NULL_HANDLE)
GSK_VK_CHECK (vkCreateImageView, gdk_vulkan_context_get_device (self->vulkan),
&(VkImageViewCreateInfo) {
.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
.image = self->vk_image,