From 1a9e03f0c8f80345b1d5e7b6434e377be59a24c8 Mon Sep 17 00:00:00 2001 From: Tony Barbour Date: Tue, 13 Sep 2016 11:45:37 -0600 Subject: layers: Only save p-devices if call was successful Change-Id: Ife211b1b2dc97c5bab0d6e7b177ead6b1a6105d3 --- layers/core_validation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'layers/core_validation.cpp') diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 3b73f274..0030793d 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -11238,7 +11238,7 @@ VKAPI_ATTR VkResult VKAPI_CALL EnumeratePhysicalDevices(VkInstance instance, uin my_data->instance_dispatch_table->EnumeratePhysicalDevices(instance, pPhysicalDeviceCount, pPhysicalDevices); if (NULL == pPhysicalDevices) { my_data->instance_state->physical_devices_count = *pPhysicalDeviceCount; - } else { // Save physical devices + } else if (result == VK_SUCCESS){ // Save physical devices for (uint32_t i = 0; i < *pPhysicalDeviceCount; i++) { layer_data *phy_dev_data = get_my_data_ptr(get_dispatch_key(pPhysicalDevices[i]), layer_data_map); phy_dev_data->physical_device_state = unique_ptr(new PHYSICAL_DEVICE_STATE()); -- cgit v1.2.3