layers: Fix buffer_view destroy ordering
authorTobin Ehlis <tobine@google.com>
Thu, 6 Oct 2016 03:50:14 +0000 (21:50 -0600)
committerTobin Ehlis <tobine@google.com>
Thu, 6 Oct 2016 13:38:58 +0000 (07:38 -0600)
Don't destroy buffer_view from map until after invalidating bound cmd buffers.

layers/core_validation.cpp

index 86f1a8a..7e82210 100644 (file)
@@ -5804,9 +5804,9 @@ static bool PreCallValidateDestroyBufferView(layer_data *dev_data, VkBufferView
 
 static void PostCallRecordDestroyBufferView(layer_data *dev_data, VkBufferView buffer_view, BUFFER_VIEW_STATE *buffer_view_state,
                                             VK_OBJECT obj_struct) {
-    dev_data->bufferViewMap.erase(buffer_view);
     // Any bound cmd buffers are now invalid
     invalidateCommandBuffers(buffer_view_state->cb_bindings, obj_struct);
+    dev_data->bufferViewMap.erase(buffer_view);
 }
 
 VKAPI_ATTR void VKAPI_CALL