From bd0c4b7fc3fb0e7febd82a5103249022d84c0b6f Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Mon, 17 Sep 2018 20:48:11 +0900 Subject: [PATCH] swapchain_tpl: Fixed wrong managing of tpl objects. Change-Id: I6ecfc05b03081764ff0752e5ef2a838b84c672f6 Signed-off-by: Joonbum Ko --- src/wsi/swapchain_tpl.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/wsi/swapchain_tpl.c b/src/wsi/swapchain_tpl.c index a62a256..35117c4 100644 --- a/src/wsi/swapchain_tpl.c +++ b/src/wsi/swapchain_tpl.c @@ -142,11 +142,15 @@ swapchain_tpl_deinit(VkDevice device, if (swapchain_tpl) { tpl_surface_destroy_swapchain(swapchain_tpl->tpl_surface); - if (swapchain_tpl->tpl_surface) + if (swapchain_tpl->tpl_surface) { tpl_object_unreference((tpl_object_t *)swapchain_tpl->tpl_surface); + swapchain_tpl->tpl_surface = NULL; + } - if (swapchain_tpl->tpl_display) + if (swapchain_tpl->tpl_display) { tpl_object_unreference((tpl_object_t *)swapchain_tpl->tpl_display); + swapchain_tpl->tpl_display = NULL; + } vk_free(chain->allocator, swapchain_tpl); } @@ -226,7 +230,7 @@ swapchain_tpl_init(VkDevice device, native_window, TPL_SURFACE_TYPE_WINDOW, format); else - tpl_object_reference((tpl_object_t *)swapchain_tpl->tpl_surface); + tpl_object_unreference((tpl_object_t *)swapchain_tpl->tpl_display); VK_CHECK(swapchain_tpl->tpl_surface, goto error, "tpl_surface_create() failed.\n"); -- 2.7.4