tpl_wayland_egl_thread: Changed the calling order of g_source_remove_fd(). 97/151897/5
authorjoonbum.ko <joonbum.ko@samsung.com>
Fri, 22 Sep 2017 08:21:18 +0000 (17:21 +0900)
committerjoonbum.ko <joonbum.ko@samsung.com>
Mon, 25 Sep 2017 02:53:59 +0000 (11:53 +0900)
Change-Id: Idd1250427579bb6cf9b1b5ff92515c708952ec3c
Signed-off-by: joonbum.ko <joonbum.ko@samsung.com>
src/tpl_wayland_egl_thread.c

index 511ce56..54803ed 100644 (file)
@@ -195,8 +195,6 @@ _twe_thread_del_source_finalize(GSource *source)
        TPL_LOG_T("WL_EGL", "gsource(%p) event_fd(%d)",
                          source, del_source->event_fd);
 
-       g_source_remove_unix_fd(source, del_source->tag);
-
        close(del_source->event_fd);
 
        del_source->tag = NULL;
@@ -273,6 +271,7 @@ _twe_del_source_init(twe_thread_context *ctx, void *target_source)
 void
 _twe_del_source_fini(twe_del_source *source)
 {
+       g_source_remove_unix_fd(&source->gsource, source->tag);
        g_source_destroy(&source->gsource);
        g_source_unref(&source->gsource);
 }
@@ -311,8 +310,6 @@ _twe_thread_tdm_source_finalize(GSource *source)
        TPL_LOG_T("WL_EGL", "tdm_destroy| tdm_source(%p) tdm_client(%p)",
                          tdm_source, tdm_source->tdm_client);
 
-       g_source_remove_unix_fd(source, tdm_source->tag);
-
        if (tdm_source->tdm_client) {
                tdm_client_destroy(tdm_source->tdm_client);
                tdm_source->tdm_client = NULL;
@@ -382,6 +379,7 @@ _twe_thread_tdm_source_destroy(void *source)
 
        g_mutex_lock(&_twe_ctx->thread_mutex);
 
+       g_source_remove_unix_fd(&tdm_source->gsource, tdm_source->tag);
        g_source_destroy(&tdm_source->gsource);
        g_source_unref(&tdm_source->gsource);
 
@@ -1501,8 +1499,6 @@ _twe_thread_wl_surface_finalize(GSource *source)
        TPL_LOG_T("WL_EGL", "gsource(%p) event_fd(%d)",
                          source, surf_source->event_fd);
 
-       g_source_remove_unix_fd(source, surf_source->tag);
-
        close(surf_source->event_fd);
        surf_source->event_fd = -1;
 
@@ -1742,6 +1738,7 @@ _twe_thread_wl_surf_source_destroy(void *source)
 
        TPL_OBJECT_UNLOCK(&disp_source->obj);
 
+       g_source_remove_unix_fd(&surf_source->gsource, surf_source->tag);
        g_source_destroy(&surf_source->gsource);
        g_source_unref(&surf_source->gsource);