From 856dee6178214a53ac4f8bb76768f1cb38f9434c Mon Sep 17 00:00:00 2001 From: "joonbum.ko" Date: Wed, 3 Jan 2018 18:06:17 +0900 Subject: [PATCH] tpl_wayland_egl_thread: Added an exception checking. Change-Id: Id3562d0832f7ab5d911dd83d9b7571e349a62751 Signed-off-by: joonbum.ko --- src/tpl_wayland_egl_thread.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/tpl_wayland_egl_thread.c b/src/tpl_wayland_egl_thread.c index 7274b2f..d865a69 100644 --- a/src/tpl_wayland_egl_thread.c +++ b/src/tpl_wayland_egl_thread.c @@ -292,7 +292,7 @@ _twe_del_source_init(twe_thread_context *ctx, void *target_source) source = (twe_del_source *)g_source_new(&_twe_del_source_funcs, sizeof(twe_del_source)); if (!source) { - TPL_ERR("[THREAD] Failed to create GSource"); + TPL_ERR("[THREAD] Failed to create twe_del_source."); return NULL; } @@ -947,6 +947,11 @@ twe_display_add(twe_thread* thread, source = (twe_wl_disp_source *)g_source_new(&_twe_wl_disp_funcs, sizeof(twe_wl_disp_source)); + if (!source) { + TPL_ERR("Failed to create twe_wl_disp_source."); + return NULL; + } + source->disp = display; source->ev_queue = ev_queue; source->wl_tbm_client = wl_tbm_client; @@ -2261,7 +2266,6 @@ twe_surface_add(twe_thread* thread, twe_thread_context *ctx = thread->ctx; twe_wl_surf_source *source = NULL; twe_wl_disp_source *disp_source = (twe_wl_disp_source *)twe_display; - GIOChannel *event_channel = NULL; gboolean is_destroyed = FALSE; tbm_surface_queue_h tbm_queue = NULL; @@ -2275,8 +2279,7 @@ twe_surface_add(twe_thread* thread, source = (twe_wl_surf_source *)g_source_new(&_twe_wl_surface_funcs, sizeof(twe_wl_surf_source)); if (!source) { - TPL_ERR("[THREAD] Failed to create GSource from event_channel(%p)", - event_channel); + TPL_ERR("[THREAD] Failed to create twe_wl_surf_source"); return NULL; } -- 2.7.4