summaryrefslogtreecommitdiff
path: root/src/portal/tracker-main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/portal/tracker-main.c')
-rw-r--r--src/portal/tracker-main.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/portal/tracker-main.c b/src/portal/tracker-main.c
index e8977fc4b..8c0429c76 100644
--- a/src/portal/tracker-main.c
+++ b/src/portal/tracker-main.c
@@ -76,7 +76,6 @@ name_acquired_callback (GDBusConnection *connection,
gpointer user_data)
{
g_debug ("Name '%s' acquired", name);
- g_main_loop_quit (user_data);
}
static void
@@ -123,23 +122,20 @@ main (int argc, char *argv[])
return EXIT_FAILURE;
}
- main_loop = g_main_loop_new (NULL, FALSE);
+ portal = tracker_portal_new (connection, NULL, &error);
+ if (!portal) {
+ g_printerr ("%s", error->message);
+ return EXIT_FAILURE;
+ }
g_bus_own_name_on_connection (connection,
"org.freedesktop.portal.Tracker",
G_BUS_NAME_OWNER_FLAGS_NONE,
name_acquired_callback,
name_lost_callback,
- g_main_loop_ref (main_loop),
- (GDestroyNotify) g_main_loop_unref);
+ NULL, NULL);
- g_main_loop_run (main_loop);
-
- portal = tracker_portal_new (connection, NULL, &error);
- if (!portal) {
- g_printerr ("%s", error->message);
- return EXIT_FAILURE;
- }
+ main_loop = g_main_loop_new (NULL, FALSE);
g_unix_signal_add (SIGINT, sigterm_cb, main_loop);
g_unix_signal_add (SIGTERM, sigterm_cb, main_loop);