diff options
author | Jason Ekstrand <[email protected]> | 2016-11-10 21:32:32 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-11-16 20:07:23 -0800 |
commit | 49f08ad77f51cc344e4bfe60ba9f8d9fccfbd753 (patch) | |
tree | 6c4d7b7776e4ef4bd1a6880943e466e80c7f3058 /src/intel/vulkan/anv_pass.c | |
parent | d0646c8015015b90bcc933e23bdd927cc0c81bb7 (diff) |
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" <[email protected]>
Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_pass.c')
-rw-r--r-- | src/intel/vulkan/anv_pass.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_pass.c b/src/intel/vulkan/anv_pass.c index 6eaa5c85cab..1f35a42765d 100644 --- a/src/intel/vulkan/anv_pass.c +++ b/src/intel/vulkan/anv_pass.c @@ -146,6 +146,9 @@ void anv_DestroyRenderPass( ANV_FROM_HANDLE(anv_device, device, _device); ANV_FROM_HANDLE(anv_render_pass, pass, _pass); + if (!pass) + return; + vk_free2(&device->alloc, pAllocator, pass->subpass_attachments); vk_free2(&device->alloc, pAllocator, pass); } |