Call DestroyInstance on each driver in error path
authorCharles Giessen <charles@lunarg.com>
Sat, 25 Feb 2023 01:09:47 +0000 (18:09 -0700)
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>
Mon, 27 Feb 2023 20:41:16 +0000 (13:41 -0700)
commit3db19f3e3d8b0c96dc1ffcb5888c06e306df478c
treed70d0920a46bec0ea109554ff63823c2b144262c
parentebf8ae00ab430c05e8b454765a85901b6acaf3ad
Call DestroyInstance on each driver in error path

If CreateInstance successfully calls terminator_CreateInstance but subsequently fails on the way
back up the chain, the loader should call DestroyInstance on each driver to give them a chance to
clean up. This path is possible during CTS OOM tests which cause VVL to fail which then causes
leaks to occur.

Additionally, the layer name allocations needed to be cleaned up in this error
path as well, since there is no chance for vkDestroyInstance to run.
loader/loader.c
loader/trampoline.c