Fix glib warning messages 17/215117/3
authorHwankyu Jhun <h.jhun@samsung.com>
Tue, 1 Oct 2019 23:05:23 +0000 (08:05 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Tue, 1 Oct 2019 23:20:21 +0000 (08:20 +0900)
Change-Id: I5bc39b4a808aae9eafc4d750ee9bccf061cbe404
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/aul_worker.c

index b0e78d0..33a5e9a 100644 (file)
@@ -88,13 +88,17 @@ static struct anr_timer_s *__create_anr_timer(void)
 static void __destroy_job(gpointer data)
 {
        struct job_s *job = (struct job_s *)data;
+       GSource *source;
+
+       if (job->tag) {
+               source = g_main_context_find_source_by_id(NULL, job->tag);
+               if (source && !g_source_is_destroyed(source))
+                       g_source_remove(job->tag);
+       }
 
        if (job->channel)
                g_io_channel_unref(job->channel);
 
-       if (job->tag)
-               g_source_remove(job->tag);
-
        free(job->name);
        free(job);
 }