layers: PR767, Fix crash exiting smoketest
authorMark Lobodzinski <mark@lunarg.com>
Fri, 15 Jul 2016 19:53:44 +0000 (13:53 -0600)
committerMark Lobodzinski <mark@lunarg.com>
Fri, 15 Jul 2016 21:11:59 +0000 (15:11 -0600)
Commit a86b57c caused a Windows crash when shutting down smoketest.
Command buffer cleanup for object bindings wasn't happening when
calling DestroyCommandPool.

Change-Id: Ie233763e37ed9bc6988dddbf932aa3eda2960940

layers/core_validation.cpp

index 0057db1..1414bd5 100644 (file)
@@ -5603,6 +5603,9 @@ DestroyCommandPool(VkDevice device, VkCommandPool commandPool, const VkAllocatio
     for (auto cb : pPool->commandBuffers) {
         clear_cmd_buf_and_mem_references(dev_data, cb);
         auto cb_node = getCBNode(dev_data, cb);
+        for (auto obj : cb_node->object_bindings) {
+            removeCommandBufferBinding(dev_data, &obj, cb_node);
+        }
         dev_data->commandBufferMap.erase(cb); // Remove this command buffer
         delete cb_node;                       // delete CB info structure
     }