Commit e5f77f73 authored by Iason Paraskevopoulos's avatar Iason Paraskevopoulos
Browse files

Fix layer's memory errors



Fixes the wrong allocation of extensions properties.

Adds a call to the dispacher's DestroyInstance function before the
destruction of the instance.

Change-Id: I169bb3ba670d89e30af1f6ce47c536477978c169
Signed-off-by: Iason Paraskevopoulos's avatarIason Paraskevopoulos <iason.paraskevopoulos@arm.com>
parent f782eab9
Pipeline #235003 passed with stage
in 1 minute and 17 seconds
/*
* Copyright (c) 2016-2019 Arm Limited.
* Copyright (c) 2016-2020 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
......@@ -59,7 +59,7 @@ VKAPI_ATTR VkResult extension_properties(const uint32_t count, const VkExtension
}
size = *pCount < count ? *pCount : count;
memcpy(pProp, layer_ext, size * sizeof(VkLayerProperties));
memcpy(pProp, layer_ext, size * sizeof(VkExtensionProperties));
*pCount = size;
if (size < count)
{
......@@ -195,6 +195,10 @@ extern "C"
VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL
wsi_layer_vkDestroyInstance(VkInstance instance, const VkAllocationCallbacks *pAllocator)
{
assert(instance);
layer::instance_private_data::get(layer::get_key(instance))
.disp.DestroyInstance(instance, pAllocator);
layer::instance_private_data::destroy(instance);
}
......
/*
* Copyright (c) 2018-2019 Arm Limited.
* Copyright (c) 2018-2020 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
......@@ -37,6 +37,7 @@
V(GetPhysicalDeviceSurfaceCapabilitiesKHR) \
V(GetPhysicalDeviceSurfaceFormatsKHR) \
V(GetPhysicalDeviceSurfacePresentModesKHR) \
V(DestroyInstance) \
V(GetPhysicalDeviceSurfaceSupportKHR)
namespace layer
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment