diff options
| author | Courtney Goeltzenleuchter <courtney@LunarG.com> | 2015-06-23 08:50:27 -0600 |
|---|---|---|
| committer | Courtney Goeltzenleuchter <courtney@LunarG.com> | 2015-06-24 15:38:03 -0600 |
| commit | 950863eef13e54eb4ce53a85ef10111fea31519c (patch) | |
| tree | 1905a711e737e6c175542a5f4233dc0d81f143a5 /layers/screenshot.cpp | |
| parent | 10ff338de8a7701dd196444f0bf698d154c63bce (diff) | |
| download | usermoji-950863eef13e54eb4ce53a85ef10111fea31519c.tar.xz | |
screenshot: Need a DestroyInstance
Need way to clean up resources allocated at CreateInstance.
Diffstat (limited to 'layers/screenshot.cpp')
| -rw-r--r-- | layers/screenshot.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/layers/screenshot.cpp b/layers/screenshot.cpp index 19b1d4aa..90d5c037 100644 --- a/layers/screenshot.cpp +++ b/layers/screenshot.cpp @@ -288,6 +288,18 @@ VkResult VKAPI vkCreateInstance( return result; } +// hook DestroyInstance to remove tableInstanceMap entry +VK_LAYER_EXPORT VkResult VKAPI vkDestroyInstance(VkInstance instance) +{ + // Grab the key before the instance is destroyed. + dispatch_key key = get_dispatch_key(instance); + VkLayerInstanceDispatchTable *pTable = get_dispatch_table(screenshot_instance_table_map, instance); + VkResult res = pTable->DestroyInstance(instance); + + screenshot_instance_table_map.erase(key); + return res; +} + static void createDeviceRegisterExtensions(const VkDeviceCreateInfo* pCreateInfo, VkDevice device) { uint32_t i, ext_idx; |
