From bfd50aac499c6870c27bb3fd71e5ebb14013264d Mon Sep 17 00:00:00 2001 From: "joonbum.ko" Date: Tue, 14 Nov 2017 11:21:41 +0900 Subject: [PATCH] wsi: Fixed ref count management in tpl_display. Change-Id: I6d66fad20251e84b6b2c2566c9a6d59c5a4c29cf Signed-off-by: joonbum.ko --- src/wsi/wsi.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/wsi/wsi.h b/src/wsi/wsi.h index 624623a..89a24f5 100644 --- a/src/wsi/wsi.h +++ b/src/wsi/wsi.h @@ -196,14 +196,13 @@ vk_get_tpl_display(VkIcdSurfaceBase *sfc) tpl_display_t *display = tpl_display_get(native_dpy); - if (display != NULL) { - tpl_object_reference((tpl_object_t *)display); - return display; - } - else { + if (display == NULL) display = tpl_display_create(type, native_dpy); - return display; - } + + if (display != NULL) + tpl_object_reference((tpl_object_t *)display); + + return display; }; static inline tpl_handle_t -- 2.7.4