aboutsummaryrefslogtreecommitdiff
path: root/loader/loader.c
diff options
context:
space:
mode:
authorJon Ashburn <jon@lunarg.com>2015-08-14 12:51:47 -0600
committerJon Ashburn <jon@lunarg.com>2015-08-24 09:17:44 -0600
commitfa6801657f1f2c9e01699d16b3a6e6e64fb42a42 (patch)
treefd912d2a5bca64a2512197999c350bf2295ac298 /loader/loader.c
parentfa494f6c296ae26c7abf40dfdb4be0e99503e354 (diff)
downloadusermoji-fa6801657f1f2c9e01699d16b3a6e6e64fb42a42.tar.xz
loader: Make the global/instance ext list once for each instance
Also fix some bugs in the heap_alloc/heap_free. Also fix some memory leaks.
Diffstat (limited to 'loader/loader.c')
-rw-r--r--loader/loader.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/loader/loader.c b/loader/loader.c
index 1dc69a4d..c70d3775 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -125,7 +125,7 @@ void* loader_aligned_heap_alloc(
size_t alignment,
VkSystemAllocType alloc_type)
{
- if (!instance && instance->alloc_callbacks.pfnAlloc) {
+ if (instance && instance->alloc_callbacks.pfnAlloc) {
return instance->alloc_callbacks.pfnAlloc(instance->alloc_callbacks.pUserData, size, alignment, alloc_type);
}
#if defined(_WIN32)
@@ -139,7 +139,7 @@ void loader_heap_free(
struct loader_instance *instance,
void *pMem)
{
- if (!instance && instance->alloc_callbacks.pfnFree) {
+ if (instance && instance->alloc_callbacks.pfnFree) {
instance->alloc_callbacks.pfnFree(instance->alloc_callbacks.pUserData, pMem);
return;
}
@@ -2450,6 +2450,7 @@ VkResult VKAPI loader_DestroyInstance(
}
+ loader_destroy_ext_list(&ptr_instance->ext_list);
return VK_SUCCESS;
}