OSDN Git Service
(root)
/
android-x86
/
external-mesa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
anv: Handle null in all destructors
[android-x86/external-mesa.git]
/
src
/
intel
/
vulkan
/
anv_descriptor_set.c
diff --git
a/src/intel/vulkan/anv_descriptor_set.c
b/src/intel/vulkan/anv_descriptor_set.c
index
97108fa
..
578bf7b
100644
(file)
--- a/
src/intel/vulkan/anv_descriptor_set.c
+++ b/
src/intel/vulkan/anv_descriptor_set.c
@@
-200,6
+200,9
@@
void anv_DestroyDescriptorSetLayout(
ANV_FROM_HANDLE(anv_device, device, _device);
ANV_FROM_HANDLE(anv_descriptor_set_layout, set_layout, _set_layout);
ANV_FROM_HANDLE(anv_device, device, _device);
ANV_FROM_HANDLE(anv_descriptor_set_layout, set_layout, _set_layout);
+ if (!set_layout)
+ return;
+
vk_free2(&device->alloc, pAllocator, set_layout);
}
vk_free2(&device->alloc, pAllocator, set_layout);
}
@@
-282,6
+285,9
@@
void anv_DestroyPipelineLayout(
ANV_FROM_HANDLE(anv_device, device, _device);
ANV_FROM_HANDLE(anv_pipeline_layout, pipeline_layout, _pipelineLayout);
ANV_FROM_HANDLE(anv_device, device, _device);
ANV_FROM_HANDLE(anv_pipeline_layout, pipeline_layout, _pipelineLayout);
+ if (!pipeline_layout)
+ return;
+
vk_free2(&device->alloc, pAllocator, pipeline_layout);
}
vk_free2(&device->alloc, pAllocator, pipeline_layout);
}
@@
-355,6
+361,9
@@
void anv_DestroyDescriptorPool(
ANV_FROM_HANDLE(anv_device, device, _device);
ANV_FROM_HANDLE(anv_descriptor_pool, pool, _pool);
ANV_FROM_HANDLE(anv_device, device, _device);
ANV_FROM_HANDLE(anv_descriptor_pool, pool, _pool);
+ if (!pool)
+ return;
+
anv_state_stream_finish(&pool->surface_state_stream);
vk_free2(&device->alloc, pAllocator, pool);
}
anv_state_stream_finish(&pool->surface_state_stream);
vk_free2(&device->alloc, pAllocator, pool);
}
@@
-546,6
+555,9
@@
VkResult anv_FreeDescriptorSets(
for (uint32_t i = 0; i < count; i++) {
ANV_FROM_HANDLE(anv_descriptor_set, set, pDescriptorSets[i]);
for (uint32_t i = 0; i < count; i++) {
ANV_FROM_HANDLE(anv_descriptor_set, set, pDescriptorSets[i]);
+ if (!set)
+ continue;
+
anv_descriptor_set_destroy(device, pool, set);
}
anv_descriptor_set_destroy(device, pool, set);
}