anv: Handle null in all destructors
This fixes a bunch of new CTS tests which look for exactly this. Even in the cases where we just call vk_free to free a CPU data structure, we still handle NULL explicitly. This way we're less likely to forget to handle NULL later should we actually do something less trivial. Cc: "13.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
@@ -262,6 +262,9 @@ void anv_FreeCommandBuffers(
|
||||
for (uint32_t i = 0; i < commandBufferCount; i++) {
|
||||
ANV_FROM_HANDLE(anv_cmd_buffer, cmd_buffer, pCommandBuffers[i]);
|
||||
|
||||
if (!cmd_buffer)
|
||||
continue;
|
||||
|
||||
anv_cmd_buffer_destroy(cmd_buffer);
|
||||
}
|
||||
}
|
||||
@@ -758,6 +761,9 @@ void anv_DestroyCommandPool(
|
||||
ANV_FROM_HANDLE(anv_device, device, _device);
|
||||
ANV_FROM_HANDLE(anv_cmd_pool, pool, commandPool);
|
||||
|
||||
if (!pool)
|
||||
return;
|
||||
|
||||
list_for_each_entry_safe(struct anv_cmd_buffer, cmd_buffer,
|
||||
&pool->cmd_buffers, pool_link) {
|
||||
anv_cmd_buffer_destroy(cmd_buffer);
|
||||
|
Reference in New Issue
Block a user