loader: device array dealloc fix

This commit is contained in:
Marcin Kańtoch 2022-06-23 17:46:34 +02:00 committed by Charles Giessen
parent 5249c8f869
commit e91cfe1cf9

View File

@ -5448,6 +5448,13 @@ VKAPI_ATTR void VKAPI_CALL terminator_DestroyInstance(VkInstance instance, const
loader_scanned_icd_clear(ptr_instance, &ptr_instance->icd_tramp_list);
loader_destroy_generic_list(ptr_instance, (struct loader_generic_list *)&ptr_instance->ext_list);
if (NULL != ptr_instance->phys_devs_term) {
for (uint32_t i = 0; i < ptr_instance->phys_dev_count_term; i++) {
for (uint32_t j = i+1; j < ptr_instance->phys_dev_count_term; j++) {
if (ptr_instance->phys_devs_term[i] == ptr_instance->phys_devs_term[j]) {
ptr_instance->phys_devs_term[j] = NULL;
}
}
}
for (uint32_t i = 0; i < ptr_instance->phys_dev_count_term; i++) {
loader_instance_heap_free(ptr_instance, ptr_instance->phys_devs_term[i]);
}