aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornyorain <nyorain@gmail.com>2022-01-21 15:47:40 +0100
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>2022-01-26 15:48:54 -0700
commit6c1bb942c25e610e03e9ab7f8685ff929c9dc92f (patch)
tree82a454d37c81034e8afed1dce7cd08f8cade0180
parent3ed7fe55cdd334a552ffd33d6d8d80496ecc96cf (diff)
downloadusermoji-6c1bb942c25e610e03e9ab7f8685ff929c9dc92f.tar.xz
Fix FreeCommandBuffers leak
-rw-r--r--icd/generated/mock_icd.cpp5
-rw-r--r--scripts/mock_icd_generator.py6
2 files changed, 10 insertions, 1 deletions
diff --git a/icd/generated/mock_icd.cpp b/icd/generated/mock_icd.cpp
index 5b1c03f4..bf876e12 100644
--- a/icd/generated/mock_icd.cpp
+++ b/icd/generated/mock_icd.cpp
@@ -1251,7 +1251,10 @@ static VKAPI_ATTR void VKAPI_CALL FreeCommandBuffers(
uint32_t commandBufferCount,
const VkCommandBuffer* pCommandBuffers)
{
-//Destroy object
+
+ for (auto i = 0u; i < commandBufferCount; ++i)
+ if (pCommandBuffers[i])
+ DestroyDispObjHandle((void*) pCommandBuffers[i]);
}
static VKAPI_ATTR VkResult VKAPI_CALL BeginCommandBuffer(
diff --git a/scripts/mock_icd_generator.py b/scripts/mock_icd_generator.py
index a2360b5f..310e81e9 100644
--- a/scripts/mock_icd_generator.py
+++ b/scripts/mock_icd_generator.py
@@ -444,6 +444,11 @@ CUSTOM_C_INTERCEPTS = {
DestroyDispObjHandle((void*)instance);
}
''',
+'vkFreeCommandBuffers': '''
+ for (auto i = 0u; i < commandBufferCount; ++i)
+ if (pCommandBuffers[i])
+ DestroyDispObjHandle((void*) pCommandBuffers[i]);
+''',
'vkEnumeratePhysicalDevices': '''
VkResult result_code = VK_SUCCESS;
if (pPhysicalDevices) {
@@ -1360,6 +1365,7 @@ class MockICDOutputGenerator(OutputGenerator):
'vkDestroyDevice',
'vkCreateInstance',
'vkDestroyInstance',
+ 'vkFreeCommandBuffers',
#'vkCreateDebugReportCallbackEXT',
#'vkDestroyDebugReportCallbackEXT',
'vkEnumerateInstanceLayerProperties',