From: Hwankyu Jhun Date: Thu, 22 Oct 2020 05:26:40 +0000 (+0900) Subject: Close IO channel before releasing it X-Git-Tag: accepted/tizen/6.0/unified/20201110.010748~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=77d0c4e505d98428e516fea50c8b1c5e986c6d8e;p=platform%2Fcore%2Fappfw%2Faul-1.git Close IO channel before releasing it Change-Id: I7b9b7e17d21f28c1b9944076dec197de5b3ee3a0 Signed-off-by: Hwankyu Jhun --- diff --git a/src/aul_worker.c b/src/aul_worker.c index ce16572..66611b4 100644 --- a/src/aul_worker.c +++ b/src/aul_worker.c @@ -90,6 +90,17 @@ static void __destroy_job(gpointer data) struct job_s *job = (struct job_s *)data; GSource *source; GMainContext *context; + GError *error = NULL; + + if (job->channel) { + g_io_channel_shutdown(job->channel, TRUE, &error); + if (error) { + _E("g_io_channel_shutdown() is failed. error(%s)", + error->message); + g_error_free(error); + } + g_io_channel_unref(job->channel); + } if (job->tag) { context = g_main_context_get_thread_default(); @@ -98,9 +109,6 @@ static void __destroy_job(gpointer data) g_source_destroy(source); } - if (job->channel) - g_io_channel_unref(job->channel); - free(job->name); free(job); }