increase reference count of tpl_display when the vulkan-wsi-tizen calls tpl_display_get()
it prevents segfault/abort when the vk_DestroySwapchainKHR is called.
Change-Id: I89e8162bbe63682e7617d1279b83b2af33fed942
tpl_surface_destroy_swapchain(chain->tpl_surface);
free(chain->buffers);
- if (chain->tpl_display)
- tpl_object_unreference((tpl_object_t *)chain->tpl_display);
-
if (chain->tpl_surface)
tpl_object_unreference((tpl_object_t *)chain->tpl_surface);
+ if (chain->tpl_display)
+ tpl_object_unreference((tpl_object_t *)chain->tpl_display);
+
vk_free(&chain->allocator, chain);
}
vk_get_tpl_display(tpl_handle_t native_dpy)
{
tpl_display_t *display = tpl_display_create(TPL_BACKEND_WAYLAND_VULKAN_WSI, native_dpy);
- if (display == NULL)
+ if (display == NULL) {
display = tpl_display_get(native_dpy);
+ tpl_object_reference((tpl_object_t *)display);
+ }
return display;
};