From 9e295ad9f6f117e93d775567d9e3770cd6021be9 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Wed, 27 May 2020 17:09:42 +0900 Subject: [PATCH] Fix a bug about removing GSource - Uses g_source_destroy() instead of g_source_remove() Error Log: +---------------------------------------------------------------------------+ | serviceapp[12098]: Source ID 2 was not found when attempting to remove it | +---------------------------------------------------------------------------+ Change-Id: I1d6c0af10ec94025cee44af8723f541a0a06e703 Signed-off-by: Hwankyu Jhun --- src/aul_worker.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/aul_worker.c b/src/aul_worker.c index 33a5e9a..ce16572 100644 --- a/src/aul_worker.c +++ b/src/aul_worker.c @@ -89,11 +89,13 @@ static void __destroy_job(gpointer data) { struct job_s *job = (struct job_s *)data; GSource *source; + GMainContext *context; if (job->tag) { - source = g_main_context_find_source_by_id(NULL, job->tag); + context = g_main_context_get_thread_default(); + source = g_main_context_find_source_by_id(context, job->tag); if (source && !g_source_is_destroyed(source)) - g_source_remove(job->tag); + g_source_destroy(source); } if (job->channel) -- 2.7.4