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 authored and Colin Walters committed 2013-09-09 12:06:01 -04:00
1 parent 3ff4b1874c
commit f802822034
1 file changed
+1 -1
+1 -1
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;