- 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 <joonbum.ko@samsung.com>
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;