From: Joonbum Ko Date: Thu, 29 Sep 2022 12:04:56 +0000 (+0900) Subject: Delete wrong g_main_context_unref X-Git-Tag: accepted/tizen/unified/20221006.151841~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7dfe9d051ec17276e10a6f935b45c7c0d63f1770;p=platform%2Fcore%2Fuifw%2Flibtpl-egl.git Delete wrong g_main_context_unref - GMainContext is also destroyed when GMainLoop is destroyed. Therefore, it is the wrong code to do context_unref before loop_unref. Change-Id: Ib57eab7ba4345565977102abb0df3268d7f42acb Signed-off-by: Joonbum Ko --- diff --git a/src/tpl_utils_gthread.c b/src/tpl_utils_gthread.c index 20bab7f..f1dab0c 100644 --- a/src/tpl_utils_gthread.c +++ b/src/tpl_utils_gthread.c @@ -70,12 +70,14 @@ tpl_gthread_create(const char *thread_name, return NULL; } + // context's ref count was increased in g_main_loop_new g_main_context_unref(context); new_thread = calloc(1, sizeof(tpl_gthread)); if (!new_thread) { TPL_ERR("Failed to allocate tpl_gthread"); - g_main_context_unref(context); + + // context is also destroyed when loop is destroyed. g_main_loop_unref(loop); return NULL;