From: Joonbum Ko Date: Thu, 19 Nov 2020 02:13:17 +0000 (+0900) Subject: Initialize presentation_feedbacks list to NULL when created. X-Git-Tag: submit/tizen/20201119.033406~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=901351750e27d9e439a24608a73b49f000b62578;p=platform%2Fcore%2Fuifw%2Flibtpl-egl.git Initialize presentation_feedbacks list to NULL when created. Change-Id: Id969409745c1c6a5bef01c49b80e6c37535e5409 Signed-off-by: Joonbum Ko --- diff --git a/src/tpl_wayland_egl_thread.c b/src/tpl_wayland_egl_thread.c index e9630cb..84b6d86 100755 --- a/src/tpl_wayland_egl_thread.c +++ b/src/tpl_wayland_egl_thread.c @@ -1099,7 +1099,7 @@ _twe_thread_wl_disp_source_destroy(void *source) _twe_display_print_err(disp_source, "dispatch_queue_pending"); } - if (disp_source->presentation_feedbacks) + if (disp_source->presentation && disp_source->presentation_feedbacks) __tpl_list_free(disp_source->presentation_feedbacks, (tpl_free_func_t)free); wl_event_queue_destroy(disp_source->ev_queue); @@ -1174,6 +1174,8 @@ twe_display_add(twe_thread* thread, TPL_DISPLAY_PRESENT_MODE_FIFO; _twe_display_wayland_init(source); + source->presentation_feedbacks = NULL; + if (source->presentation) source->presentation_feedbacks = __tpl_list_alloc(); @@ -2399,8 +2401,9 @@ __cb_presentation_feedback_discarded(void *data, if (presentation_feedback) wp_presentation_feedback_destroy(presentation_feedback); - __tpl_list_remove_data(disp_source->presentation_feedbacks, feedback_info, - TPL_FIRST, (tpl_free_func_t)free); + if (disp_source->presentation_feedbacks) + __tpl_list_remove_data(disp_source->presentation_feedbacks, feedback_info, + TPL_FIRST, (tpl_free_func_t)free); g_mutex_unlock(&surf_source->pst_mutex); } @@ -2442,7 +2445,9 @@ _twe_thread_wl_surface_commit(twe_wl_surf_source *surf_source, feedback_info->surf_source = surf_source; wp_presentation_feedback_add_listener(feedback_info->feedback, &feedback_listener, feedback_info); - __tpl_list_push_back(disp_source->presentation_feedbacks, (void *)feedback_info); + if (disp_source->presentation_feedbacks) + __tpl_list_push_back(disp_source->presentation_feedbacks, + (void *)feedback_info); } } g_mutex_unlock(&surf_source->pst_mutex);