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)
This commit is contained in:
Vivek Dasmohapatra 2013-09-09 15:54:26 +01:00 committed by Colin Walters
parent 3ff4b1874c
commit f802822034

View File

@ -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;