From e8dc397bfd169e5f6baa252b660cf3c1518d9004 Mon Sep 17 00:00:00 2001 From: Greg Daniel Date: Thu, 15 Jul 2021 13:38:44 -0400 Subject: In VuklanManager make sure we have a valid semaphore context before destroying it. If errors occured during finishFrame that caused us to not have a semaphore or possibly destroy the semaphore early we will end up with a null mDestroySemaphoreContext in swapBuffers which we tried to destroy unconditionally. I haven't repro'd the connected bug, but based on the crash stack this seems like the likely cause. Test: manual code inspection and build. Bug: 191950033 Change-Id: I0fbd33edff3552b91b980da9e3b2c45bc52a2dd0 --- libs/hwui/renderthread/VulkanManager.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libs/hwui/renderthread/VulkanManager.cpp') diff --git a/libs/hwui/renderthread/VulkanManager.cpp b/libs/hwui/renderthread/VulkanManager.cpp index f70149111116..9e8a1e141fe1 100644 --- a/libs/hwui/renderthread/VulkanManager.cpp +++ b/libs/hwui/renderthread/VulkanManager.cpp @@ -579,7 +579,9 @@ void VulkanManager::swapBuffers(VulkanSurface* surface, const SkRect& dirtyRect) std::lock_guard lock(mGraphicsQueueMutex); mQueueWaitIdle(mGraphicsQueue); } - destroy_semaphore(mDestroySemaphoreContext); + if (mDestroySemaphoreContext) { + destroy_semaphore(mDestroySemaphoreContext); + } surface->presentCurrentBuffer(dirtyRect, fenceFd); mSwapSemaphore = VK_NULL_HANDLE; -- cgit v1.2.3