[glib/wip/gcleanup: 101/106] gdbus-example-export: Fix behavior when using cleanup
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/gcleanup: 101/106] gdbus-example-export: Fix behavior when using cleanup
- Date: Mon, 11 Nov 2013 08:03:29 +0000 (UTC)
commit 1ad0eb1b37a34bf0974ea8af6e697254d4f6ef00
Author: Stef Walter <stefw gnome org>
Date: Sat Nov 9 20:22:30 2013 +0100
gdbus-example-export: Fix behavior when using cleanup
https://bugzilla.gnome.org/show_bug.cgi?id=711799
gio/tests/gdbus-example-export.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gio/tests/gdbus-example-export.c b/gio/tests/gdbus-example-export.c
index 5bb74d0..a029df4 100644
--- a/gio/tests/gdbus-example-export.c
+++ b/gio/tests/gdbus-example-export.c
@@ -290,19 +290,20 @@ on_name_acquired (GDBusConnection *connection,
{
}
+static GMainLoop *loop;
+
static void
on_name_lost (GDBusConnection *connection,
const gchar *name,
gpointer user_data)
{
- exit (1);
+ g_main_loop_quit (user_data);
}
int
main (int argc, char *argv[])
{
guint owner_id;
- GMainLoop *loop;
MyObject *myobj;
/* We are lazy here - we don't want to manually provide
@@ -331,6 +332,7 @@ main (int argc, char *argv[])
g_dbus_node_info_unref (introspection_data);
g_object_unref (myobj);
+ g_main_loop_unref (loop);
return 0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]