summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-03-01 08:39:49 -0800
committerJason Ekstrand <[email protected]>2017-03-01 15:31:44 -0800
commite3d33a23e6cbe2b73b412a56bb4fc4aa6852d081 (patch)
treeaddce6d432ad85d1d5ce80cc22451563a3807544 /src/intel/vulkan
parentf3ec9d33c6a3ed4ddb42d3bf4844fc04bf4a69c8 (diff)
anv: Properly handle destroying NULL devices and instances
Reviewed-by: Lionel Landwerlin <[email protected]> Cc: "17.0 13.0" <[email protected]>
Diffstat (limited to 'src/intel/vulkan')
-rw-r--r--src/intel/vulkan/anv_device.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index 0db96f223a6..238e149a3d1 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -360,6 +360,9 @@ void anv_DestroyInstance(
{
ANV_FROM_HANDLE(anv_instance, instance, _instance);
+ if (!instance)
+ return;
+
if (instance->physicalDeviceCount > 0) {
/* We support at most one physical device. */
assert(instance->physicalDeviceCount == 1);
@@ -1095,6 +1098,9 @@ void anv_DestroyDevice(
{
ANV_FROM_HANDLE(anv_device, device, _device);
+ if (!device)
+ return;
+
anv_device_finish_blorp(device);
anv_queue_finish(&device->queue);