Fix a bug about removing GSource 88/234588/2
authorHwankyu Jhun <h.jhun@samsung.com>
Wed, 27 May 2020 08:09:42 +0000 (17:09 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Wed, 27 May 2020 08:18:48 +0000 (17:18 +0900)
- 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 <h.jhun@samsung.com>
src/aul_worker.c

index 33a5e9a..ce16572 100644 (file)
@@ -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)