[ostree] pull: ref the thread default main context during init, unref in cleanup



commit f80282203428b723a732372b5e5a882779a62434
Author: Vivek Dasmohapatra <vivek collabora co uk>
Date:   Mon Sep 9 15:54:26 2013 +0100

    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 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c
index 81d4891..ca9b017 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;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]