summaryrefslogtreecommitdiff
path: root/osinfo/osinfo_tree.c
diff options
context:
space:
mode:
authorDebarshi Ray <debarshir@gnome.org>2017-01-17 15:29:41 +0100
committerChristophe Fergeau <cfergeau@redhat.com>2017-11-06 14:40:26 +0100
commit9955c547c5fb55b161ca4905b36dcf7710175524 (patch)
tree62d6c0d506a3c8a685024ea420c7c74dc619ce4a /osinfo/osinfo_tree.c
parent25a4aa0578c6eb477b70e29d84f9eee1c3797a6c (diff)
downloadlibosinfo-9955c547c5fb55b161ca4905b36dcf7710175524.tar.gz
Marginally simplify the code to create and run a GMainLoop
Even though g_main_loop_new accepts a is_running parameter, it isn't very important since g_main_loop_run will set it to TRUE anyway. There is no requirement that it should be set before calling g_main_loop_run. The vast majority of GMainLoop users simply ignore the is_running parameter unless they are doing something out of the ordinary.
Diffstat (limited to 'osinfo/osinfo_tree.c')
-rw-r--r--osinfo/osinfo_tree.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/osinfo/osinfo_tree.c b/osinfo/osinfo_tree.c
index 565ccfe..da01c8b 100644
--- a/osinfo/osinfo_tree.c
+++ b/osinfo/osinfo_tree.c
@@ -437,7 +437,7 @@ OsinfoTree *osinfo_tree_create_from_location(const gchar *location,
data = g_slice_new0(CreateFromLocationData);
data->main_loop = g_main_loop_new(g_main_context_get_thread_default(),
- TRUE);
+ FALSE);
osinfo_tree_create_from_location_async(location,
G_PRIORITY_DEFAULT,
@@ -446,8 +446,7 @@ OsinfoTree *osinfo_tree_create_from_location(const gchar *location,
data);
/* Loop till we get a reply (or time out) */
- if (g_main_loop_is_running(data->main_loop))
- g_main_loop_run(data->main_loop);
+ g_main_loop_run(data->main_loop);
ret = osinfo_tree_create_from_location_finish(data->res, error);
create_from_location_data_free(data);