From: Hoyub Lee Date: Thu, 18 May 2017 11:36:09 +0000 (+0900) Subject: wsi: Correct getting tpl_display in vk_get_tpl_display() X-Git-Tag: submit/submit/tizen/20170906.070327/20170906.070422^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Ftizen_4.0;p=platform%2Fcore%2Fuifw%2Fvulkan-wsi-tizen.git wsi: Correct getting tpl_display in vk_get_tpl_display() tpl_display_create() has been changed to [return existing tpl_display] from [return NULL] if there is already existing one. Therefore, this patch applies this behaviour change on vk_get_tpl_display(). Change-Id: I355b251d43e6e0e54b89aa533d43f33ada997017 Signed-off-by: Hoyub Lee --- diff --git a/src/wsi/wsi.h b/src/wsi/wsi.h index e629922..624623a 100644 --- a/src/wsi/wsi.h +++ b/src/wsi/wsi.h @@ -194,12 +194,16 @@ vk_get_tpl_display(VkIcdSurfaceBase *sfc) return NULL; } - tpl_display_t *display = tpl_display_create(type, native_dpy); - if (display == NULL) { - display = tpl_display_get(native_dpy); + tpl_display_t *display = tpl_display_get(native_dpy); + + if (display != NULL) { tpl_object_reference((tpl_object_t *)display); + return display; + } + else { + display = tpl_display_create(type, native_dpy); + return display; } - return display; }; static inline tpl_handle_t