layers: Don't use instance pointer after it has been destroyed
authorCody Northrop <cnorthrop@google.com>
Tue, 12 Jul 2016 17:43:32 +0000 (11:43 -0600)
committerCody Northrop <cnorthrop@google.com>
Tue, 12 Jul 2016 19:56:52 +0000 (13:56 -0600)
commitf9760b8ef2ff145d67c8faa00371aa2538cb88f8
tree87b304d455d2044211b86c4ae6b429d4ec8314e3
parentac0445e063c290d0569a254856366d0371033b4f
layers: Don't use instance pointer after it has been destroyed

In unique_objects' explicit_DestroyInstance(), the recently introduced
second get_dispatch_table() was using a destroyed instance as a lookup
key, failing to find an entry (since the driver controls that memory
and probably freed it), and was crashing consistently on PixelC.

Instead, use the instance pointer to cleanup instanceExtMap before
calling down to the ICD's DestroyInstance.

Additionally, use the existing VkLayerInstanceDispatchTable* instead
of calling get_dispatch_table() twice.
layers/unique_objects.h