layers: Rework Destroy/Free data structure cleanup
authorTobin Ehlis <tobine@google.com>
Wed, 13 Jul 2016 15:41:09 +0000 (09:41 -0600)
committerTobin Ehlis <tobine@google.com>
Fri, 15 Jul 2016 15:28:42 +0000 (09:28 -0600)
commite21e14812ecd872491d670e260ad73da4c46da6d
treea567875c48fecb7202af3713fabe6f6775f055c8
parenta8023fac7d5f20451f97357c56d2ada49f0ebd9d
layers: Rework Destroy/Free data structure cleanup

When destroying dispatchable objects we must cleanup internal data
structures prior to calling down the chain in the event that another
thread were to prempt execution and re-allocate a freed handle prior
to the layer cleanup code executing.

For non-dispatchable handles this shouldn't be a requirement due to
the fact that layers only see unique handles. However, moved some
non-dispatchable cleanup before the call to ICD as well for consistency
and to be extra safe.
layers/core_validation.cpp