((VkDebugReportCallbackEXT *)pAllocator->pfnAllocation(
pAllocator->pUserData, n * sizeof(VkDebugReportCallbackEXT),
sizeof(void *), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT));
+ if (!pCallbacks) {
+ pAllocator->pfnFree(pAllocator->pUserData, pInfos);
+ return VK_ERROR_OUT_OF_HOST_MEMORY;
+ }
} else {
#endif
pCallbacks = *callbacks = ((VkDebugReportCallbackEXT *)malloc(
n * sizeof(VkDebugReportCallbackEXT)));
- }
- if (!pCallbacks) {
- free(pInfos);
- return VK_ERROR_OUT_OF_HOST_MEMORY;
+ if (!pCallbacks) {
+ free(pInfos);
+ return VK_ERROR_OUT_OF_HOST_MEMORY;
+ }
}
// 4th, copy each VkDebugReportCallbackCreateInfoEXT for use by
// vkDestroyInstance, and assign a unique handle to each callback (just
void util_FreeDebugReportCreateInfos(const VkAllocationCallbacks *pAllocator,
VkDebugReportCallbackCreateInfoEXT *infos,
VkDebugReportCallbackEXT *callbacks) {
- free(infos);
- free(callbacks);
+#if (DEBUG_DISABLE_APP_ALLOCATORS == 1)
+ {
+#else
+ if (pAllocator != NULL) {
+ pAllocator->pfnFree(pAllocator->pUserData, infos);
+ pAllocator->pfnFree(pAllocator->pUserData, callbacks);
+ } else {
+#endif
+ free(infos);
+ free(callbacks);
+ }
}
VkResult util_CreateDebugReportCallbacks(
}
storage_idx++;
}
+
+#if (DEBUG_DISABLE_APP_ALLOCATORS == 1)
+ {
+#else
+ if (pAllocator != NULL) {
+ pAllocator->pfnFree(pAllocator->pUserData, icd_info);
+ } else {
+#endif
+ free(icd_info);
+ }
}
/*