tpl_wayland_egl_thread: Fixed ref count bug in gsources. 24/147424/3
authorjoonbum.ko <joonbum.ko@samsung.com>
Mon, 4 Sep 2017 07:47:48 +0000 (16:47 +0900)
committerjoonbum.ko <joonbum.ko@samsung.com>
Mon, 4 Sep 2017 09:28:37 +0000 (18:28 +0900)
 - g_source_new() must match g_source_unref(),
  g_source_attach() must match g_source_destroy().

Change-Id: I5bfe99de2bed6abfbff9f0a61ff20eeb33533048
Signed-off-by: joonbum.ko <joonbum.ko@samsung.com>
src/tpl_wayland_egl_thread.c

index e95bb04..5912b91 100644 (file)
@@ -124,7 +124,6 @@ _twe_thread_loop(gpointer data)
                if (tdm_source) {
                        g_source_attach(&tdm_source->gsource,
                                                        g_main_loop_get_context(ctx->twe_loop));
-                       g_source_unref(&tdm_source->gsource);
                }
 
                _twe_ctx->tdm_source = tdm_source;
@@ -681,7 +680,6 @@ _twe_display_del_source_init(twe_thread *thread,
        source->disp_source = disp_source;
 
        g_source_attach(&source->gsource, g_main_loop_get_context(ctx->twe_loop));
-       g_source_unref(&source->gsource);
 
        return source;
 }
@@ -1642,7 +1640,6 @@ twe_surface_add(twe_thread* thread,
 
        g_source_set_callback(&source->gsource, NULL, surface, NULL);
        g_source_attach(&source->gsource, g_main_loop_get_context(ctx->twe_loop));
-       g_source_unref(&source->gsource);
 
        TPL_LOG_T("WL_EGL",
                          "gsource(%p) wl_egl_window(%p) wl_surface(%p) event_fd(%d)",