From f80282203428b723a732372b5e5a882779a62434 Mon Sep 17 00:00:00 2001 From: Vivek Dasmohapatra Date: Mon, 9 Sep 2013 15:54:26 +0100 Subject: [PATCH] pull: ref the thread default main context during init, unref in cleanup ...get_thread_default returns NULL when the thread default is also the global default, so this only shows up when running in a thread (eg g_task_run_in_thread) --- src/libostree/ostree-repo-pull.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c index 81d4891e..ca9b017c 100644 --- a/src/libostree/ostree-repo-pull.c +++ b/src/libostree/ostree-repo-pull.c @@ -1148,7 +1148,7 @@ ostree_repo_pull (OstreeRepo *self, guint64 end_time; pull_data->async_error = error; - pull_data->main_context = g_main_context_get_thread_default (); + pull_data->main_context = g_main_context_ref_thread_default (); pull_data->loop = g_main_loop_new (pull_data->main_context, FALSE); pull_data->flags = flags;