From: Iason Paraskevopoulos Date: Thu, 26 Nov 2020 18:00:05 +0000 (+0000) Subject: Fix erroneous behaviour in error cases X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5b2b2511f70d1e29cfcc8dc41331643e56983ad3;p=platform%2Fcore%2Fuifw%2Fvulkan-wsi-tizen.git Fix erroneous behaviour in error cases Corrects error handling when image creation fails and fixes shutdown behaviour in error cases. Change-Id: I29b9fbd237b90f6007e4731d9019efb6b4c256ff Signed-off-by: Iason Paraskevopoulos --- diff --git a/wsi/headless/swapchain.cpp b/wsi/headless/swapchain.cpp index 4f09886..a12f29b 100644 --- a/wsi/headless/swapchain.cpp +++ b/wsi/headless/swapchain.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 Arm Limited. + * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -61,7 +61,10 @@ VkResult swapchain::create_image(const VkImageCreateInfo &image_create, wsi::swa { VkResult res = VK_SUCCESS; res = m_device_data.disp.CreateImage(m_device, &image_create, nullptr, &image.image); - assert(VK_SUCCESS == res); + if (res != VK_SUCCESS) + { + return res; + } VkMemoryRequirements memory_requirements; m_device_data.disp.GetImageMemoryRequirements(m_device, image.image, &memory_requirements); diff --git a/wsi/swapchain_base.cpp b/wsi/swapchain_base.cpp index 737dc5b..be50e36 100644 --- a/wsi/swapchain_base.cpp +++ b/wsi/swapchain_base.cpp @@ -322,11 +322,17 @@ void swapchain_base::teardown() } /* If descendant started presenting, there is no pending buffer in the swapchain. */ - if (descendent_started_presenting == false) + if (m_is_valid && descendent_started_presenting == false) { wait_for_pending_buffers(); } + if (m_queue != VK_NULL_HANDLE) + { + /* Make sure the vkFences are done signaling. */ + vkQueueWaitIdle(m_queue); + } + /* Make sure the vkFences are done signaling. */ m_device_data.disp.QueueWaitIdle(m_queue);