From: joonbum.ko Date: Tue, 14 Nov 2017 02:21:41 +0000 (+0900) Subject: wsi: Fixed ref count management in tpl_display. X-Git-Tag: accepted/tizen/unified/20171228.065020~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bfd50aac499c6870c27bb3fd71e5ebb14013264d;p=platform%2Fcore%2Fuifw%2Fvulkan-wsi-tizen.git wsi: Fixed ref count management in tpl_display. Change-Id: I6d66fad20251e84b6b2c2566c9a6d59c5a4c29cf Signed-off-by: joonbum.ko --- 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