summaryrefslogtreecommitdiff
path: root/libs/gui/BufferQueueConsumer.cpp
diff options
context:
space:
mode:
author Jesse Hall <jessehall@google.com> 2016-03-05 22:27:02 -0800
committer Jesse Hall <jessehall@google.com> 2016-03-07 00:57:21 +0000
commitfee714302b86f0d48b417dff7b928f5b825f8e27 (patch)
tree5f3f6bcc77ab761150597d41eefd9a96a340673e /libs/gui/BufferQueueConsumer.cpp
parent49f0a0cddbcad9be1d408425ee608ca925c6885b (diff)
libvulkan: Fix double-free, refactor instance destruction
Fixes dEQP-VK.api.object_management.alloc_callback_fail.instance. Since we were calling DestroyInstance_Bottom from both CreateInstance_Bottom and CreateInstance_Top failure paths, we were calling the driver's DestroyInstance twice. To avoid such bugs, this change clears the driver instance handle to VK_NULL_HANDLE after calling the driver DestroyInstance. But the real fix in this change is to make creation and destruction symmetric. Now DestroyInstance_Bottom only cleans up the things that were initialized/allocated in CreateInstance_Bottom, and is only called from CreateInstance_Bottom failure paths and from a dispatched vkDestroyInstance. Similarly, DestroyInstance_Top and failure paths in CreateInstance_Top call DestroyInstance (formerly TeardownInstance) to clean up things initialized/allocated in CreateInstance_Top. The direct calls from *_Top functions to DestroyInstance_Bottom are gone -- *_Top functions should only reach *_Bottom functions via dispatch, so the call goes through enabled layers. Bug: 27493757 Change-Id: I4e9f8508297813415499dc17803fff49ce9abdcf (cherry picked from commit 15cd1e269fd2dacef8b95006928b122b9dabbeea)
Diffstat (limited to 'libs/gui/BufferQueueConsumer.cpp')
0 files changed, 0 insertions, 0 deletions