diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c index 0e0c64d2cb6..f44bb5c901d 100644 --- a/src/vulkan/wsi/wsi_common_wayland.c +++ b/src/vulkan/wsi/wsi_common_wayland.c @@ -162,7 +162,6 @@ struct wsi_wl_surface { /* This has no functional use, and is here only for perfetto */ struct { - const VkAllocationCallbacks *pAllocator; char *latency_str; uint64_t presenting; uint64_t presentation_track_id; @@ -1345,11 +1344,12 @@ wsi_wl_surface_get_present_rectangles(VkIcdSurfaceBase *surface, } static void -wsi_wl_surface_analytics_fini(struct wsi_wl_surface *wsi_wl_surface) +wsi_wl_surface_analytics_fini(struct wsi_wl_surface *wsi_wl_surface, + const VkAllocationCallbacks *parent_pAllocator, + const VkAllocationCallbacks *pAllocator) { - const VkAllocationCallbacks *pAllocator = wsi_wl_surface->analytics.pAllocator; - - vk_free(pAllocator, wsi_wl_surface->analytics.latency_str); + vk_free2(parent_pAllocator, pAllocator, + wsi_wl_surface->analytics.latency_str); } void @@ -1375,7 +1375,7 @@ wsi_wl_surface_destroy(VkIcdSurfaceBase *icd_surface, VkInstance _instance, if (wsi_wl_surface->display) wsi_wl_display_destroy(wsi_wl_surface->display); - wsi_wl_surface_analytics_fini(wsi_wl_surface); + wsi_wl_surface_analytics_fini(wsi_wl_surface, &instance->alloc, pAllocator); vk_free2(&instance->alloc, pAllocator, wsi_wl_surface); } @@ -1597,9 +1597,6 @@ wsi_wl_surface_analytics_init(struct wsi_wl_surface *wsi_wl_surface, uint64_t wl_id; char *track_name; - wl_id = wl_proxy_get_id((struct wl_proxy *) wsi_wl_surface->surface); - - wsi_wl_surface->analytics.pAllocator = pAllocator; wl_id = wl_proxy_get_id((struct wl_proxy *) wsi_wl_surface->surface); track_name = vk_asprintf(pAllocator, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT, "wl%" PRIu64 " presentation", wl_id);