layers: Move call to validateCommandBuffersNotInUse inside lock
authorTony Barbour <tony@LunarG.com>
Thu, 7 Apr 2016 00:17:57 +0000 (18:17 -0600)
committerTony Barbour <tony@LunarG.com>
Thu, 7 Apr 2016 00:27:04 +0000 (18:27 -0600)
Fixes segv in CTS multithreaded command pool test

Change-Id: I80da12fd2bb6856e3c6824f17dd92f1597121a54

layers/core_validation.cpp

index a78e54a..13e3845 100644 (file)
@@ -6094,9 +6094,12 @@ vkDestroyCommandPool(VkDevice device, VkCommandPool commandPool, const VkAllocat
     }
     dev_data->commandPoolMap.erase(commandPool);
 
+
+    VkBool32 result = validateCommandBuffersNotInUse(dev_data, commandPool);
+
     loader_platform_thread_unlock_mutex(&globalLock);
 
-    if (validateCommandBuffersNotInUse(dev_data, commandPool))
+    if (result)
         return;
 
     if (!skipCall)